09.08.2014, 08:29
(
Последний раз редактировалось Hammomd; 09.08.2014 в 09:47.
Причина: Changing some mistakes
)
pawn Код:
case 4:
{
PlayAudioStreamForPlayer(playerid, "http://*******/DeathSound.mp3");
new pname[MAX_PLAYER_NAME], string[22 + MAX_PLAYER_NAME];
new Float:X;
new Float:Y;
new Float:Z;
GetPlayerName(playerid, pname, sizeof(pname));
format(string, sizeof(string), "%s(%d) is Dying.", pname, playerid);
SendClientMessageToAll(0xAAAAAAAA, string);
GetPlayerPos(playerid, X, Y, Z);
SetTimerEx("Passed", 2000, 0, "i", player); //Add the Timer 2000 Miliseconds = 2 seconds
// SetTimerEx("Callback(in this chase)",miliseconds (1000ms = 1 second), 1 = repeat| 0 = don't repeat, format, playerid (In this chase));
}
//Put this in some place of your GM (i recommend in the end) but not insede of any public
forward Passed(playerid);
public Passed(playerid)
{
new PName[MAX_PLAYER_NAME], string[MAX_PLAYER_NAME+14]; //Define some variables
GetPlayerName(playerid, PName, sizeof (PName)); //Get the name to "PName"
format(string, sizeof(string),"%s(%d) has passed on", PName , playerid); //Set the Text to %s == PName == Playername | %d == playerid
SetPlayerHealth(playerid, 0.0);//Kill player
SendClientMessageToAll(0xFFFFFF, string); //Send a message to all players
}