19.11.2011, 12:14
Hi users, scripters
i want to make a system if a player dies his name comes in the chat with died or something...
this is what i maked
but it won't work :S
i want to make a system if a player dies his name comes in the chat with died or something...
this is what i maked
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
if (killerid == INVALID_PLAYER_ID) {
switch (reason) {
case WEAPON_DROWN:
{
format(string, sizeof(string), " %s drowned.)", playerid);
}
default:
{
if (strlen(deathreason) > 0) {
format(string, sizeof(string), " %s died. (%s)", playerid, deathreason);
} else {
format(string, sizeof(string), " %s died.", playerid);
}
}
}
}
else {
new killer[MAX_PLAYER_NAME];
GetPlayerName(killerid, killer, sizeof(killer));
if (strlen(deathreason) > 0) {
format(string, sizeof(string), " %s killed %s. (%s)", killer, playerid, deathreason);
} else {
format(string, sizeof(string), " %s killed %s.", killer, playerid);
}
}
SendClientMessageToAll(COLOR_RED, string);
{
playercash = GetPlayerMoney(playerid);
if (playercash > 0)
{
GivePlayerMoney(killerid, playercash);
ResetPlayerMoney(playerid);
}
else
{
}
}
return 1;
}