Death Help
#1

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;
}
Reply
#2

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.
Reply
#3

Change "u" to "d"

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


Forum Jump:


Users browsing this thread: 2 Guest(s)