13.05.2015, 10:57
Disable class selection
This include allows you to disable class selection with ease, without playing around with the spectator functions.
You can also use this include to hide the class selection buttons without spawning the player.
Usage
All you need to do is include it after a_samp:
This works by enabling spectator mode in OnPlayerRequestClass() to hide the class selection buttons. There is one callback available:
After OnPlayerRequestClass has been called and the buttons have been hidden, the callback above will be called.
It can be used to show the login dialog, spawn the player, or set the player's camera.
Spawning the player
Use SpawnPlayer() to simply spawn the player after they are done logging in or whatever.
There is a bug in SA-MP where using SpawnPlayer after TogglePlayerSpectating will kick you. In this instance, you can safely spawn a player without any problems.
Disable class selection
If you want to completely disable class selection and spawn the player after they connect, do this:
Download
https://www.dropbox.com/s/eawh6oo8z7...class.inc?dl=1
This include allows you to disable class selection with ease, without playing around with the spectator functions.
You can also use this include to hide the class selection buttons without spawning the player.
Usage
All you need to do is include it after a_samp:
pawn Code:
#include <a_samp>
#include <noclass>
pawn Code:
// Called when a player has fully connected to the server.
public OnPlayerFullyConnected(playerid);
It can be used to show the login dialog, spawn the player, or set the player's camera.
Spawning the player
Use SpawnPlayer() to simply spawn the player after they are done logging in or whatever.
pawn Code:
public OnPlayerLogin(playerid)
{
if (cache_get_row_count(gConnection))
{
SetSpawnInfo(playerid, NO_TEAM, 255, 1280.0, -1024.0, 20.0, 180.0, 0, 0, 0, 0, 0, 0);
SpawnPlayer(playerid);
}
}
Disable class selection
If you want to completely disable class selection and spawn the player after they connect, do this:
pawn Code:
public OnPlayerFullyConnected(playerid)
{
SpawnPlayer(playerid);
}
https://www.dropbox.com/s/eawh6oo8z7...class.inc?dl=1