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

Hello,
I Need a system in which when i kill any Player i should get 1 score and some random money like $20000 to $30000 !
Here's my GM : Here It Is !

Hope You Will Help Me,
Thanks
Reply
#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
#3

Thx Worked
Reped +1
Reply
#4

Hey when a Player do /kill, it gives money to them too and scores toooo
Reply
#5

Quote:
Originally Posted by Avi57
Посмотреть сообщение
Hey when a Player do /kill, it gives money to them too and scores toooo
Код:
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;
}
Reply
#6

Quote:
Originally Posted by [MM]RoXoR[FS]
Посмотреть сообщение
Код:
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;
}
GivePlayerMoney(playerid,....
GivePlayerMoney(killerid,....

shouldnt the killer get the money or what ^^ ?

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(killerid, random(30000 - 10000) + 10000);}//Randomizes the amount of cash the person gets, 20000 - 30000
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)