local points = math.max(0,getPlayerStorageValue(cid, 7035))
local points = getPlayerStorageValue(cid, 7035)
local points = getPlayerStorageValue(cid, 7035)
function onStepIn(cid, item, position, fromPosition)
if item.uid == 4000 then
doSendMagicEffect(position, 13)
if getPlayerStorageValue(cid, 7035) >= 1 then
doPlayerSendTextMessage(cid, 17, "You have " ..points.. " points.")
else
doPlayerSendTextMessage(cid, 17, "You have zero points! Donate today to get more points.")
end
end
return true
end
int LuaScriptInterface::luaGetPlayerStorageValue(lua_State *L)
{
//getPlayerStorageValue(cid, valueid)
uint32_t key = popNumber(L);
uint32_t cid = popNumber(L);
ScriptEnviroment* env = getScriptEnv();
const Player* player = env->getPlayerByUID(cid);
if(player){
int32_t value;
if(player->getStorageValue(key, value)){
lua_pushnumber(L, value);
lua_pushboolean(L, true);
}
else{
lua_pushnumber(L, -1);
lua_pushboolean(L, false);
}
}
else{
reportErrorFunc(getErrorDesc(LUA_ERROR_PLAYER_NOT_FOUND));
lua_pushnumber(L, -1);
lua_pushboolean(L, false);
}
return 2;
}