• attempt to call global 'isSteamID' (a nil value)
    8 replies, posted
Hello all. I have same error with my script.Please help me) error : [code]ERROR: Hook 'ISaid' Failed: [lua/autorun/server/inviter.lua:37] attempt to call global 'isSteamID' (a nil value) Removing Hook 'ISaid'[/code] script :[lua]local ST_String local text local public local result local CheckPlayer local function IsSteamID( ST_String ) return (type(ST_String) == "string" && (ST_String:match( "^STEAM_%d:%d:%d+$" ) || ST_String:match( "^loopback$" ) || ST_String:match( "^localhost:?%d*$"))) || false end local function tables_exist() if (sql.TableExists("invites")) then print("table alredy create") else if (!sql.TableExists("invites")) then query = "CREATE TABLE invites (id MEDIUMINT NOT NULL AUTO_INCREMENT, inviter varchar(255) NOT NULL, friendId varchar(255) NOT NULL , active varchar(1) NOT NULL)" result = sql.Query(query) end end end local function CheckPlayerOnline(CheckPlayer) for k, v in pairs(player.GetAll()) do if(v:SteamID() == CheckPlayer) then return 1 else return 0 end end end local function ISaid( ply, text, public ) if (string.sub(text, 1, 4) == "/inv") then local steamid = string.sub( text, 5 ) if(isSteamID(steamid)) then result = sql.Query("SELECT COUNT(*) FROM invites WHERE friendId = '"..steamid.."'") if(result == 1) then ply:ChatPrint("Этот человек уже приглашен на сервер." ) elseif(CheckPlayerOnline(steamid)) then ply:ChatPrint("Этот человек уже играет на сервер.") else result = sql.Query("INSERT INTO invites (inviter,friendId,active) VALUES ('"..ply:SteamID().."','"..steamid.."','0')") ply:ChatPrint("Спасибо." ) end else ply:ChatPrint( "Синтаксис команды \"/inv SteamId\", SteamID - SteamID друга которого вы приглашаете на сервер.") end end end local function CheckInv(ply) result = sql.Query("SELECT COUNT(*) FROM invites WHERE friendId = '"..ply:SteamID().."'") if(result == 1) then sql.Query("UPDATE invites SET active=1") ply:ChatPrint("Спасибо что откликнулись на приглашение.") end end tables_exist() hook.Add( "PlayerSay", "ISaid", ISaid ); hook.Add( "PlayerConnect", "CheckInv", ply);[/lua]
Use [.lua][./lua] You misspelled your function IsSteamID() at line 37
I know myself, but where exactly error? >.>
[QUOTE=InfernalCookie;34775941]You misspelled your function IsSteamID() at [b]line 37[/b][/QUOTE] ??
i newbie and i don't know exactly what the error is and how to fix(
Lua is case sensitive, you wrote isSteamID, you meant IsSteamID
To be fair if he doesn't know that, I'm pretty sure most of that is copy-pasted anyhow.
-snip- Oooooh, okay.
[QUOTE=InfernalCookie;34789242]Well, I told him to use the lua tags.. but he had isSteamID but it's supposed to be IsSteamID[/QUOTE] I was replying to him, he said he didn't know where the error was so I told him again
Sorry, you need to Log In to post a reply to this thread.