[HELP]Get Score When Player Kill Another Player
#2

pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    if(killerid != INVALID_PLAYER_ID) SetPlayerScore(killerid, GetPlayerScore(killerid) + 1); //If not invalid killerid (not a vehicle, etcetra), gets current score and adds one to the killer.
    GivePlayerMoney(playerid, random(30000 - 10000) + 10000);//Randomizes the amount of cash the person gets, 20000 - 30000
    return 1;
}
Untested, I rarely use randoms, and when I do, I look at examples. Found an example on the forums and edited it to your liking.

Explanation of the code is shown in the code.
Reply


Messages In This Thread
[HELP]Get Score When Player Kill Another Player - by Avi57 - 17.06.2012, 15:53
Re: [HELP]Get Score When Player Kill Another Player - by Kindred - 17.06.2012, 16:02
Re: [HELP]Get Score When Player Kill Another Player - by Avi57 - 17.06.2012, 16:08
Re: [HELP]Get Score When Player Kill Another Player - by Avi57 - 18.06.2012, 02:43
Re: [HELP]Get Score When Player Kill Another Player - by [MM]RoXoR[FS] - 18.06.2012, 12:20
Re: [HELP]Get Score When Player Kill Another Player - by HuSs3n - 18.06.2012, 12:29

Forum Jump:


Users browsing this thread: 1 Guest(s)