Skip class selection after death
#1

how i skip class selection after i dead, and assign to previous team before im die

can you tell me the code/script for that
Reply
#2

You only have to choose your class once, and then you respawn with it.
Reply
#3

nope, in my script when im death, it return to class selection (im swear im not press F4)

any supporting script?
Reply
#4

Read this
Quote:
Returning 0 in this callback will prevent the player from spawning. The player can be forced to spawn when SpawnPlayer is used, however the player will re-enter class selection the next time they die.
Reply
#5

So, I have to put
pawn Код:
return 0;
On OnPlayerDeath?

EDIT: im already use return 0; in the OnPlayerRequestClass
i add return 0; in the script and got Unreachable Code
pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
    {
      SetPlayerPos(playerid, 1424.1958,-973.2076,57.5156);
      SetPlayerCameraPos(playerid, 1423.8972,-976.9398,57.5156);
      SetPlayerFacingAngle(playerid, 176.5765);
      SetPlayerCameraLookAt(playerid, 1424.1958,-973.2076,57.5156);

      ForceClassSelection(playerid);
      TogglePlayerSpectating(playerid, true);
      TogglePlayerSpectating(playerid, false);
      TogglePlayerControllable(playerid,0);
      if(GetPlayerSkin(playerid) == 105) GameTextForPlayer(playerid,"~g~Grove Street Families",2000,5);
      if(GetPlayerSkin(playerid) == 280) GameTextForPlayer(playerid,"~b~Police Officer",2000,5);
      if(GetPlayerSkin(playerid) == 29) GameTextForPlayer(playerid,"~w~Civilian",2000,5);
      if(GetPlayerSkin(playerid) == 61) GameTextForPlayer(playerid,"~y~Pilot",2000,5);
      SetPlayerTeamFromClass(playerid, classid);
      new gPlayerCitySelection[MAX_PLAYERS];
      new gPlayerHasCitySelected[MAX_PLAYERS];
      new gPlayerLastCitySelectionTick[MAX_PLAYERS];
      gPlayerHasCitySelected[playerid] = 0;
      gPlayerCitySelection[playerid] = 0;
      gPlayerLastCitySelectionTick[playerid] = 0;
      return 0;
    }
    return 1;
}
In return 1; line
Reply
#6

You misunderstood me. If you want to spawn and skip class selection, return 1. Don't return 0.
Reply
#7

Quote:
Originally Posted by RedFusion
Посмотреть сообщение
You misunderstood me. If you want to spawn and skip class selection, return 1. Don't return 0.
Can you just give me the PAWN code?
Reply
#8

pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
      SetPlayerPos(playerid, 1424.1958,-973.2076,57.5156);
      SetPlayerCameraPos(playerid, 1423.8972,-976.9398,57.5156);
      SetPlayerFacingAngle(playerid, 176.5765);
      SetPlayerCameraLookAt(playerid, 1424.1958,-973.2076,57.5156);

      ForceClassSelection(playerid);
      TogglePlayerSpectating(playerid, true);
      TogglePlayerSpectating(playerid, false);
      TogglePlayerControllable(playerid,0);
      if(GetPlayerSkin(playerid) == 105) GameTextForPlayer(playerid,"~g~Grove Street Families",2000,5);
      if(GetPlayerSkin(playerid) == 280) GameTextForPlayer(playerid,"~b~Police Officer",2000,5);
      if(GetPlayerSkin(playerid) == 29) GameTextForPlayer(playerid,"~w~Civilian",2000,5);
      if(GetPlayerSkin(playerid) == 61) GameTextForPlayer(playerid,"~y~Pilot",2000,5);
      SetPlayerTeamFromClass(playerid, classid);
      new gPlayerCitySelection[MAX_PLAYERS];
      new gPlayerHasCitySelected[MAX_PLAYERS];
      new gPlayerLastCitySelectionTick[MAX_PLAYERS];
      gPlayerHasCitySelected[playerid] = 0;
      gPlayerCitySelection[playerid] = 0;
      gPlayerLastCitySelectionTick[playerid] = 0;
    return 1;
}
Reply
#9

Still Taking Me To Class Selection
Reply
#10

show your onplayerdeath callback
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)