SA-MP Forums Archive
Add Player Score. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Add Player Score. (/showthread.php?tid=194896)



Add Player Score. - ThePwherer - 30.11.2010

Can anybody help me make a script that shows up a text such as (PlatyerName) Got pwned by (PlayerName)? After wich a score will be added to the killer.


Re: Add Player Score. - lavamike - 30.11.2010

Well get both player's name in OnPlayerDeath, then do what you want, example:
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    new player[24];  // ID of player that died
    new killer[24];  // ID of killer
    GetPlayerName(playerid, player, sizeof(player)); // Player that died name
    GetPlayerName(killerid, killer, sizeof(killer));  // Killers name

    // Use a GameText or SendClientMessage to send the messages you want to killerid or playerid.
    // Or use SendClientMessage or SendClientMessageToAll, whatever you want to do is your choice with messages

    // To update score:
    SetPlayerScore(killerid, GetPlayerScore(killerid) + 1);
}
Hope that helps

https://sampwiki.blast.hk/wiki/GetPlayerName
https://sampwiki.blast.hk/wiki/GameTextForPlayer
https://sampwiki.blast.hk/wiki/SetPlayerScore


Re: Add Player Score. - ThePwherer - 30.11.2010

Thanks!