SA-MP Forums Archive
PAWN Lang Scripting Questions - 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: PAWN Lang Scripting Questions (/showthread.php?tid=144927)



PAWN Lang Scripting Questions - Torran - 29.04.2010

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?


Re: PAWN Lang Scripting Questions - biltong - 29.04.2010

Quote:
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?
1. Need to know what script you have, but can probably be fixed with SetTimerEx.

2. I think I recall a filterscript or something that allows this, but I can't remember. If not, then I doubt it's possible.


Re: PAWN Lang Scripting Questions - dice7 - 29.04.2010

1. Just send the player somewhere else, freeze him and change the camera
2. Change the camera

And this has nothing to do with the actual language


Re: PAWN Lang Scripting Questions - coole210 - 29.04.2010

Show code

if your not comfortable showing the whole code than show parts

btw incase you didn't know (which i think you do know) 2500 = 2.5 seconds
25000 = 25 seconds


Re: PAWN Lang Scripting Questions - Torran - 29.04.2010

Quote:
Originally Posted by dice7
1. Just send the player somewhere else, freeze him and change the camera
2. Change the camera
1. Yeah works ty!
2. By that you mean SetPlayerCameraPos?


Re: PAWN Lang Scripting Questions - RyDeR` - 29.04.2010

Quote:
Originally Posted by Joe Torran C
Quote:
Originally Posted by dice7
1. Just send the player somewhere else, freeze him and change the camera
2. Change the camera
1. Yeah works ty!
2. By that you mean SetPlayerCameraPos?
You can use my OnPlayerRequestClass maker for getting the correct view.


Re: PAWN Lang Scripting Questions - Torran - 29.04.2010

Quote:
Originally Posted by » RyDeR «
Quote:
Originally Posted by Joe Torran C
Quote:
Originally Posted by dice7
1. Just send the player somewhere else, freeze him and change the camera
2. Change the camera
1. Yeah works ty!
2. By that you mean SetPlayerCameraPos?
You can use my OnPlayerRequestClass maker for getting the correct view.
Yeah i am i like your maker its awesome
Ok so yeah i got this:

pawn Code:
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;
}
Ive only tested once, But when 25 seconds was over i couldnt see my player but my camera was falling, And when i died cos i was high up, Blood appeared but no player?


Re: PAWN Lang Scripting Questions - Torran - 30.04.2010

Anyone?

Let me show you, Maybe youll get what i mean:

Code:
pawn 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);
  SetTimerEx("DeathRecovery", 25000, 0, "i", playerid);
  return 1;
}

public DeathRecovery(playerid)
{
  TogglePlayerControllable(playerid, 1);
  SetCameraBehindPlayer(playerid);
  TextDrawHideForPlayer(playerid, Text:RecoveryText);
  return 1;
}
Video:
SA:MP Problem - Invisible Player


Re: PAWN Lang Scripting Questions - Rac3r - 30.04.2010

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;
}
Might not need camera pos when player spawns, but if it doesn't work, try remove the // and see if it helps


Re: PAWN Lang Scripting Questions - Torran - 30.04.2010

Quote:
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;
}
Might not need camera pos when player spawns, but if it doesn't work, try remove the // and see if it helps
If i put SpawnPlayer under DeathRecovery callback im forever looking at the hospital and textdraw