• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Help to find the bug please

Fumobix

New Member
Joined
Sep 6, 2007
Messages
154
Reaction score
0
Well im trying to do a script but since its like my first one i did alone i cannot find the problem;

The script function is to see if in the first loging the player got 42:00 stamina if yes then it will set it back to 0


in creaturescripts:

Code:
	<event type="login" name="PlayerLogin" event="script" value="firststa.lua"/>

in scripts:
Code:
function onLogin(cid)
         if getPlayerStamina (cid)= 2520 then 
            setPlayerStamina(cid, 0)
end
end


Btw the functions of those:


//getPlayerStamina(cid)
lua_register(m_luaState, "getPlayerStamina", LuaScriptInterface::luaGetPlayerStamina);

//setPlayerStamina(cid, minutes)
lua_register(m_luaState, "setPlayerStamina", LuaScriptInterface::luaSetPlayerStamina);

//doPlayerAddStamina(cid, minutes)
lua_register(m_luaState, "doPlayerAddStamina", LuaScriptInterface::luaDoPlayerAddStamina);
 
Back
Top