07.02.2018, 09:09
example:
Код:
new timer_death[MAX_PLAYERS], timer_death2[MAX_PLAYERS];
PHP код:
public OnPlayerDeath(playerid, killerid, reason)
{
new str[60], str2[60], pName1[MAX_PLAYER_NAME], pName2[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName1, MAX_PLAYER_NAME);
GetPlayerName(killerid, pName2, MAX_PLAYER_NAME);
TextDrawShowForPlayer(playerid, killed);
format(str, sizeof(str), "You death by: %s", pName2(killerid));
TextDrawSetString(killed, str);
timer_death[playerid] = SetTimerEx("hidetd_player", 4000, false, "d", playerid);
TextDrawShowForPlayer(killerid, killedby);
format(str2, sizeof(str2), "You killed by: %s", pName(playerid);
TextDrawSetString(killedby, str);
timer_death2[killerid] = SetTimerEx("hidetd_killer", 4000, false, "d", killerid);
return 1;
}
forward hidetd_player(playerid);
public hidetd_player(playerid){
TextDrawHideForPlayer(playerid, killed);
KillTimer(timer_death[playerid]);
return 1;
}
forward hidetd_killer(killerid);
public hidetd_killer(killerid){
TextDrawHideForPlayer(killerid, killedby);
KillTimer(timer_death2[killerid]);
return 1;
}