SA-MP Forums Archive
Any Method to make Request Class Disable? - 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)
+--- Thread: Any Method to make Request Class Disable? (/showthread.php?tid=542659)



Any Method to make Request Class Disable? - VivianKris - 21.10.2014

Hi, I think lots of people coding a RolePlay Gamemode want to know that.
Thank you.


Re: Any Method to make Request Class Disable? - Sabur - 21.10.2014

public OnPlayerRequestClass(playerid,classid)
{
return 0;
}


Re: Any Method to make Request Class Disable? - VivianKris - 21.10.2014

Quote:
Originally Posted by Sabur
View Post
public OnPlayerRequestClass(playerid,classid)
{
return 0;
}
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.


Re: Any Method to make Request Class Disable? - Sabur - 21.10.2014

maybe spawn him using SetSpawnInfo and SpawnPlayer?


Re: Any Method to make Request Class Disable? - VivianKris - 21.10.2014

Quote:
Originally Posted by Sabur
View Post
maybe spawn him using SetSpawnInfo and SpawnPlayer?
I mean....

When people connected to server, they dont display Class Select Window.


Re: Any Method to make Request Class Disable? - Steel_ - 21.10.2014

Code:
 
public OnPlayerRequestClass(playerid)
{
   SpawnPlayer(playerid);
   return 1;
}



Re: Any Method to make Request Class Disable? - TwinkiDaBoss - 21.10.2014

pawn Code:
public OnPlayerRequestClass(playerid, classid)
{
    SetSpawnInfo(playerid, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0);
    TogglePlayerSpectating(playerid, true);
    //Add here what you want to happen.
    return 1;
}