Add Player Score.
#1

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.
Reply
#2

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
Reply
#3

Thanks!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)