22.09.2014, 15:46
(
Последний раз редактировалось Gogeta101; 22.09.2014 в 16:30.
)
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
SendDeathMessage(killerid, playerid, reason); // Sends Death Message to evryone in server.
GivePlayerMoney(killerid,100); // Gives killerid 100$
GivePlayerMoney(playerid,-100); // Takes playerid which died 100$
new string[128]; // a new string for killerid length 128.
new diedguy[MAX_PLAYER_NAME]; // Formating name of guy which died.
new killerguy[MAX_PLAYER_NAME]; // Formating name of guy which killed the other player.
new gunname[32]; // variable to store weapon name.
GetWeaponName(reason,gunname,sizeof(gunname)); // Formating reason with gunname.
GetPlayerName(killerid,killerguy,sizeof(killerguy)); // Formating killer name.
GetPlayerName(playerid,diedguy,sizeof(diedguy)); // Formating died guy name.
format(string,sizeof(string),"[SERVER]:Good job on killing %s with %s you got 100$ as reward.",diedguy,gunname); // formating the string with died guy and gunname.
format(string,sizeof(string),"[SERVER]:You were killed by %s using %s you lost 100$",killerguy,gunname); // Same as first string.
SendClientMessage(playerid,COLOR_YELLOW,string);// String sended to guy which died.
SendClientMessage(killerid,COLOR_YELLOW,string); // String sended to guy which got the kill.
return 1;
}