04.07.2006, 02:46
A function for displaying my kills/deaths/teamkills, just added it to my script a moment ago.
Some vars :
The function :
OnPlayerDeath() :
OnPlayerCommandText() :
Enjoy...
Some vars :
Code:
//Players kills + deaths vars new MyKills[MAX_PLAYERS]; new MyDeaths[MAX_PLAYERS]; new MyTeamKills[MAX_PLAYERS]; //Colour #define COLOR_YELLOW 0xFFFF00AA
Code:
//ShowScore ShowScore(playerid) { new tmpTotal[128]; format(tmpTotal, sizeof(tmpTotal), "Kills :%d, Deaths :%d, Team Kills :%d", MyKills[playerid], MyDeaths[playerid], MyTeamKills[playerid]); SendClientMessage(playerid, COLOR_YELLOW, tmpTotal); }
Code:
MyDeaths[playerid]++; //Put at top of the function under printf(.....) MyKills[killerid]++; //I have this under the valid kill section of code MyTeamKills[killerid]++; //I have this under the invalid(teamkill) section of code
Code:
//-------------------/score if(strcmp(cmd, "/score", true) == 0) { ShowScore(playerid); return 1; }