Originally Posted by Joe Torran C
PAWN Lang Scripting Questions
1. When a player dies, I get it to show the hospital and it says that your recovering, But after a second or two, It spawns me auto, How can i stop this spawning till the 25 second timer finishes and spawns me itself? 2. If i toggle a player spectating to 1 it shows the water near coords 0.0, 0.0, 0.0, Is there anyway to change that to something else? |
Originally Posted by dice7
1. Just send the player somewhere else, freeze him and change the camera
2. Change the camera |
Originally Posted by Joe Torran C
Quote:
2. By that you mean SetPlayerCameraPos? |
Originally Posted by » RyDeR «
Quote:
|
public OnPlayerDeath(playerid, killerid)
{
SetPlayerPos(playerid, 0.0, 0.0, 50.0);
TogglePlayerControllable(playerid, 0);
SetPlayerCameraPos(playerid, -2493.41, 645.15, 78.87);
SetPlayerCameraLookAt(playerid, -2498.31, 644.39, 78.19);
TextDrawShowForPlayer(playerid, Text:RecoveryText);
SetTimerEx("DeathRecovery", 25000, 0, "i", playerid);
return 1;
}
public DeathRecovery(playerid)
{
TogglePlayerControllable(playerid, 1);
SetCameraBehindPlayer(playerid);
TextDrawHideForPlayer(playerid, Text:RecoveryText);
return 1;
}
public OnPlayerDeath(playerid, killerid)
{
SetPlayerPos(playerid, 0.0, 0.0, 0.0);
TogglePlayerControllable(playerid, 0);
SetPlayerCameraPos(playerid, -2493.41, 645.15, 78.87);
SetPlayerCameraLookAt(playerid, -2498.31, 644.39, 78.19);
TextDrawShowForPlayer(playerid, Text:RecoveryText);
SetTimerEx("DeathRecovery", 25000, 0, "i", playerid);
return 1;
}
public DeathRecovery(playerid)
{
TogglePlayerControllable(playerid, 1);
SetCameraBehindPlayer(playerid);
TextDrawHideForPlayer(playerid, Text:RecoveryText);
return 1;
}
public OnPlayerDeath(playerid, killerid) { SetPlayerPos(playerid, 0.0, 0.0, 0.0); TogglePlayerControllable(playerid, 0); SetPlayerCameraPos(playerid, -2493.41, 645.15, 78.87); SetPlayerCameraLookAt(playerid, -2498.31, 644.39, 78.19); TextDrawShowForPlayer(playerid, Text:RecoveryText); Recovering[playerid]=1; SetTimerEx("DeathRecovery", 25000, 0, "i", playerid); return 1; } public DeathRecovery(playerid) { Recovering[playerid]=0; TogglePlayerControllable(playerid, 1); SetCameraBehindPlayer(playerid); TextDrawHideForPlayer(playerid, Text:RecoveryText); SpawnPlayer(playerid); SetCameraBehindPlayer(playerid); return 1; } public OnPlayerSpawn(playerid) { if( Recovering[playerid] ) { //SetPlayerCameraPos(playerid, -2493.41, 645.15, 78.87); //SetPlayerCameraLookAt(playerid, -2498.31, 644.39, 78.19); return 1; } //normal spawn code return 1; }
Originally Posted by Rac3r
Suppose the best way to do it would be to add a var when they die, check that when they spawn.
Code:
public OnPlayerDeath(playerid, killerid) { SetPlayerPos(playerid, 0.0, 0.0, 0.0); TogglePlayerControllable(playerid, 0); SetPlayerCameraPos(playerid, -2493.41, 645.15, 78.87); SetPlayerCameraLookAt(playerid, -2498.31, 644.39, 78.19); TextDrawShowForPlayer(playerid, Text:RecoveryText); Recovering[playerid]=1; SetTimerEx("DeathRecovery", 25000, 0, "i", playerid); return 1; } public DeathRecovery(playerid) { Recovering[playerid]=0; TogglePlayerControllable(playerid, 1); SetCameraBehindPlayer(playerid); TextDrawHideForPlayer(playerid, Text:RecoveryText); SpawnPlayer(playerid); SetCameraBehindPlayer(playerid); return 1; } public OnPlayerSpawn(playerid) { if( Recovering[playerid] ) { //SetPlayerCameraPos(playerid, -2493.41, 645.15, 78.87); //SetPlayerCameraLookAt(playerid, -2498.31, 644.39, 78.19); return 1; } //normal spawn code return 1; } |