Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- // Basic way of making a stats command, for kills and deaths. To the same to Score, Name etc
- // Create your variables
- new
- Player_Kills[MAX_PLAYERS],
- Player_Deaths[MAX_PLAYERS]
- ;
- // Or you can use the Enum way, but best to learn this way first
- public OnPlayerDeath(playerid, killerid, reason)
- {
- // Then assign your variables to OnPlayerDeath, which means when the players dies or kills
- Player_Kills[killerid] ++; // Add +1 kill to the killer id
- Player_Deaths[playerid] ++; // Add +1 death to the player that dies
- return 1;
- }
- COMMAND:stats(playerid, params[])
- {
- new string[128]; // This is your string, to store characters
- // Assign your variables to the stats string
- format(string, sizeof(string), "%d %d", Player_Kills[playerid], Player_Deaths[playerid]); // %d means number cause the variables are numbers
- SendClientMessage(playerid, -1, string); //Send the string as client message, or change this to dialog, what ever you like
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment