Getting the player kills?
#1

I'm making a simple gamemode just to test my abilities and stuff

I'm trying to make kills/deaths (without saving/storing them)


So what I've done is this:

PHP Code:
new gKills[MAX_PLAYERS];
new 
gDeaths[MAX_PLAYERS]; 
OnPlayerDeath
PHP Code:
    gKills[killerid] ++;
    
gDeaths[playerid] ++; 
and on stats command

PHP Code:
CMD:stats(playeridparams[])
{
   new
        
id,
        
PlayerName[MAX_PLAYER_NAME],
        
String[256];
        
   if(
sscanf(params"s[64]"id)) id playerid;
   
   
GetPlayerName(playeridPlayerNamesizeof(PlayerName));
   
   
format(Stringsizeof(String), "Player Name: %s | ID: %d | Kills: %d | Deaths: %d"PlayerNameplayeridgKills[id], gDeaths[id]);
   
   
SendClientMessage(playerid, -1String);
   
   return 
true;

It doesn't change on /stats command when I die.
Reply


Messages In This Thread
Getting the player kills? - by ivndosos - 11.03.2018, 11:03
Re: Getting the player kills? - by cessil - 11.03.2018, 11:10
Re: Getting the player kills? - by X337 - 11.03.2018, 11:10
Re: Getting the player kills? - by ivndosos - 11.03.2018, 11:12
Re: Getting the player kills? - by RogueDrifter - 11.03.2018, 11:29
Re: Getting the player kills? - by ivndosos - 11.03.2018, 11:30
Re: Getting the player kills? - by RogueDrifter - 11.03.2018, 11:32
Re: Getting the player kills? - by ivndosos - 11.03.2018, 11:34
Re: Getting the player kills? - by cessil - 11.03.2018, 11:36
Re: Getting the player kills? - by RogueDrifter - 11.03.2018, 11:46

Forum Jump:


Users browsing this thread: 1 Guest(s)