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:
in scripts:
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);
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);