I am attempting to skip class selection, but it doesn't work
#1

PHP код:
public OnPlayerRequestClass(playeridclassid)
{
    print(
"Request class!");
    
SetPlayerPos(playerid1958.37831343.157215.3746);
    
SetPlayerCameraPos(playerid1958.37831343.157215.3746);
    
SetPlayerCameraLookAt(playerid1958.37831343.157215.3746);
    return 
1;
}
forward InstantSpawn(playerid);
public 
InstantSpawn(playerid)
{
    
TogglePlayerSpectating(playerid0);
    
TogglePlayerControllable(playerid1);
    
SpawnPlayer(playerid);
}
public 
OnHashCheck(playerid)
{
    
//...... your typical password compare stuff
    
if(!match)
        
KickPlayer(playerid"Wrong password!");
    
SetTimerEx("InstantSpawn"10"i"playerid);
    return 
1;

I would love to get some help, I don't know what I am doing wrong (And before you ask, I did verify that OnHashCheck is being called);
Reply
#2

PHP код:
OnPlayerConnect(playerid)
{
// ............. Code
return InstantSpawn(playerid);

Reply
#3

Thanks but I still get the class selection screen.
Reply
#4

Код HTML:
public OnPlayerConnect(playerid)
{
    SetSpawnInfo(playerid, ANYCORDS, ANYCORDS, ANYCORDS, ANYANGLE, -1, 0, -1, 0, -1, 0);
    SpawnPlayer(playerid);
    SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746); 
    SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746); 
    SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746); 
    return 1; 
}
I just made the player spawn under OnPlayerConnect, so OnPlayerRequestClass won't be called.
This will prevent "Spawn" button show.
Replace all "ANYCORDS" with any cords, anyway you'll set the player pos after the spawn with this code.
Remember to change player pos and to set the camera behind the player after login/register dialog.
I hope I helped you.
Reply
#5

Thanks guys.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)