SA-MP Forums Archive
Death Help - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Death Help (/showthread.php?tid=253976)



Death Help - Luis- - 08.05.2011

I have made this little code but it for some reason doesn't want to listen to the timer set?
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    SetPlayerCameraPos(playerid, 1202.9543,-1329.6901,16.2482);
    SetPlayerCameraLookAt(playerid, 1178.5377,-1324.9832,14.1250);
    SetPlayerPos(playerid, 1173.3662,-1354.7286,13.8842);
    TogglePlayerControllable(playerid, 0);
    //SetTimer("Death", 120000, false);
    SetTimerEx("Death", 120000, false, "u", playerid);
    return 1;
}

forward Death(playerid);
public Death(playerid)
{
    SetPlayerPos(playerid, 1178.2053,-1326.0546,14.1086);
    SendClientMessage(playerid, COLOR_YELLOW, "INFO: You have been released from hospital, you have lost 25% of your memory.");
    TogglePlayerControllable(playerid, 1);
    return 1;
}



Re: Death Help - coole210 - 08.05.2011

TOP:

Код:
new Dead[MAX_PLAYERS];
Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    SetPlayerCameraPos(playerid, 1202.9543,-1329.6901,16.2482);
    SetPlayerCameraLookAt(playerid, 1178.5377,-1324.9832,14.1250);
    SetPlayerPos(playerid, 1178.2053,-1326.0546,14.1086);
    Dead[playerid] = 1;
    return 1;
}
public OnPlayerSpawn(playerid)
{
	if(Dead[playerid] == 1)
	{
	    SetPlayerCameraPos(playerid, 1202.9543,-1329.6901,16.2482);
	    SetPlayerCameraLookAt(playerid, 1178.5377,-1324.9832,14.1250);
	    SetPlayerPos(playerid, 1178.2053,-1326.0546,14.1086);
	    TogglePlayerControllable(playerid, 0);
	    SetTimerEx("Death", 120000, false, "u", playerid);
	    Dead[playerid] = 0;
	}
	return 1;
}

forward Death(playerid);
public Death(playerid)
{
    SetPlayerPos(playerid, 1178.2053,-1326.0546,14.1086);
    SendClientMessage(playerid, COLOR_YELLOW, "INFO: You have been released from hospital, you have lost 25%% of your memory.");
    TogglePlayerControllable(playerid, 1);
    return 1;
}
You need to set the player pos when he spawns.


Re: Death Help - MadeMan - 08.05.2011

Change "u" to "d"

pawn Код:
SetTimerEx("Death", 120000, false, "d", playerid);