11.04.2019, 15:57
Hello,
i have
I have problem, this command add Score %d to player, but did not update PlayerInfo[playerid][Score].
Do you have any ideas how to solve it? Thanks!
// -------------- EDIT --------------
Will this work?
i have
Code:
CMD:givepoints(playerid, params[]) { if(PlayerInfo[playerid][AdminLevel] < 3) return LowLevel(playerid); new pos; if(!params[0]||!(pos = chrfind(' ',params)+1)||!params[pos]) return SendLanguageText(playerid, SERVER_COLOR, "Pouћitн: /givepoints [ID] [POINTS]","Usage: /givepoints [ID] [POINTS]"); if(strlen(params) > 23) return SystemMessage(playerid, "[PB] Chybnй parametry!","[PB] Incorrect parameters!"); new CMD_ID = strval(params); if(!IsPlayerConnected(CMD_ID)) return NotConnected(playerid); new Castka = strval(params[pos]),string[200],string1[200]; SetPlayerScore(CMD_ID, GetPlayerScore(playerid) + Castka); if(CMD_ID == playerid) { format(string, 150, "[PB] Přidal sis %d bodů na svůj ъčet. Nynн mбљ %d bodů.", Castka,GetPlayerScore(CMD_ID)); format(string1, 150, "[PB] You added %d points to your account. Now u have %d points.", Castka,GetPlayerScore(CMD_ID)); SendLanguageText(playerid, SERVER_COLOR, string,string1); }else{ format(string, 200, "[PB] Přidal si hrбči %s %d bodů. Nynн mб %d bodů.", Jmeno(CMD_ID),Castka,GetPlayerScore(CMD_ID)); format(string1, 200, "[PB] You added %d points to player %s. Now he have %d points.", Castka,Jmeno(CMD_ID),GetPlayerScore(CMD_ID)); SendLanguageText(playerid, SERVER_COLOR, string,string1); format(string, 200, "[PB] Administrбtor %s ti přidal %d bodů. Nynн mбљ %d bodů.",Jmeno(playerid),Castka,GetPlayerScore(CMD_ID)); format(string1, 200, "[PB] Admin %s added %d points to your account. Now u have %d points.",Jmeno(playerid),Castka,GetPlayerScore(CMD_ID)); SendLanguageText(playerid, SERVER_COLOR, string,string1); } return true; }
Do you have any ideas how to solve it? Thanks!
// -------------- EDIT --------------
Code:
public OnPlayerUpdate(playerid) { PlayerInfo[playerid][Score] = GetPlayerScore(playerid); SetPlayerScore(playerid, PlayerInfo[playerid][Score]); return 1; }