Follow along with the video below to see how to install our site as a web app on your home screen.
Notka: This feature may not be available in some browsers.
//doPlayerAddMana(uid,mana)
lua_register(luaState, "doPlayerAddMana", ActionScript::luaActionDoPlayerAddMana);
//doPlayerAddPremium(uid,pacc)
lua_register(luaState, "doPlayerAddPremium", ActionScript::luaActionDoPlayerAddPremium);
int ActionScript::luaActionDoPlayerAddMana(lua_State *L)
{
//doPlayerAddMana(uid,mana)
int addmana = (int)internalGetNumber(L);
unsigned int cid = (unsigned int)internalGetNumber(L);
ActionScript *action = getActionScript(L);
const KnownThing* tmp = action->GetPlayerByUID(cid);
if(tmp){
Player *player = (Player*)(tmp->thing);
player->mana = std::min(player->manamax,player->mana+addmana);
player->sendStats();
}
else{
lua_pushnumber(L, -1);
std::cout << "luaDoPlayerAddMana: player not found" << std::endl;
return 1;
}
lua_pushnumber(L, 0);
return 1;
}
int ActionScript::luaActionDoPlayerAddPremium(lua_State *L)
{
//doPlayerAddPremium(uid,pacc)
int pacc = (int)internalGetNumber(L);
unsigned int cid = (unsigned int)internalGetNumber(L);
ActionScript *action = getActionScript(L);
const KnownThing* tmp = action->GetPlayerByUID(cid);
if(tmp){
Player *player = (Player*)(tmp->thing);
player->premiumTicks += 1000*60*(pacc);
}
else{
lua_pushnumber(L, -1);
std::cout << "luaDoPlayerAddPremium: player not found" << std::endl;
return 1;
}
lua_pushnumber(L, 0);
return 1;
}
static int luaActionDoPlayerAddMana(lua_State *L);
static int luaActionDoPlayerAddPremium(lua_State *L);
function onUse(cid, item, frompos, item2, topos)
doPlayerAddPremium(cid,15)
end[code]
[B]doPlayerAddPremium[/B](cid,15)
15 to liczba minut
Pozdrawiam