08.11.2009, 13:33
Hi there.
Iґm currently trying to create a rank system but somehow its fucked up. I dont know why. Can someone see a error here?
OnPlayerConnect -
At OnPlayerDeath..
And in a timer called every 15 seconds:
Whats wrong?
Iґm currently trying to create a rank system but somehow its fucked up. I dont know why. Can someone see a error here?
OnPlayerConnect -
Код:
new pn[MAX_PLAYER_NAME], connect[48]; GetPlayerName(playerid, pn, sizeof(pn)); format(connect, sizeof(connect), "/userfiles/%s.ini", pn ); number = dini_Int(connect,"kills"); number = killzstats[playerid];
Код:
killzstats[killerid]++;
Код:
public rankcheck() { for(new i=0; i<MAX_PLAYERS; i++) { new pn[MAX_PLAYER_NAME], connect[48]; GetPlayerName(i, pn, sizeof(pn)); format(connect, sizeof(connect), "/userfiles/%s.ini", pn ); dini_IntSet(connect,"kills", killzstats[i]); if(killzstats[i] >= 0) { rank[i] = 0; TextDrawSetString(ranktext[i],"Rank: Private"); } else if(killzstats[i] > 19) { rank[i] = 1; TextDrawSetString(ranktext[i],"Rank: Soldier"); } else if(killzstats[i] > 49) { rank[i] = 2; TextDrawSetString(ranktext[i],"Rank: Sergeant"); } else if(killzstats[i] > 100) { rank[i] = 3; TextDrawSetString(ranktext[i],"Rank: General"); } } }