PAWN Lang Scripting Questions
#1

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?
Reply
#2

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

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
Reply
#4

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
Reply
#5

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?
Reply
#6

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

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?
Reply
#8

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
Reply
#9

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
Reply
#10

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)