Using TogglePlayerSpectating and spawning the player ?
#1

Well , Basically - How my system go :

- Once you open the server - Register/login dialog pops up
- After putting your password - "< - > - SPAWN" appear.
- You click "spawn" - So the dialogs appear of registering [age / date of birth.. etc] OR you spawn if you're logging in.


- I tried using TogglePlayerSpectating(playerid, 1);

But - What it do is , After entering your pass in the dialogs - It just stops.. I can't click "SPAWN" as it doesn't exist anymore and I don't proceed to the dialogs/spawning


So my question is - How to proceed the player to the dialogs/spawning without remove TogglePlayerSpectating(playerid, 1); or forcing him to click "SPAWN".

Thanks in advance.
Reply
#2

try something like this


PHP Code:
public OnPlayerConnect(playerid)
{
    
SetSpawnInfo(playerid,0,0,0,0,0,45.0,0,0,0,0,0,0);
    
SpawnPlayer(playerid);     
    
TogglePlayerSpectating(playerid,true);
    
//show the dialogs for register/login
    
return 1;

If you want more dialogs to appear after registering, do something like this
PHP Code:
public OnDialogResponse(playerid,response,listitem,inputtext)
{
    if(
dialogid == REGISTER_DIALOG)
    {
        
//register the players account with your system
        //Show them the age dialog
    
}
    else if(
dialogid == AGE_DIALOG)
    {
         
//show them the gender dialog
    
}
    else if(
dialogid == GENDER_DIALOG)
    {
       
//okay since the player has now registered set their and and gender lets stick them to their first spawn!
       
TogglePlayerSpectating(playerid,false);
       
SetSpawnInfo(playerid,team,skin,X,Y,Z,FacingAngle,Gun1,Ammo1,Gun2,Ammo2,Gun3,Ammo3);
       
SpawnPlayer(playerid);
    }    
    else if(
dialogid == login)
    {
         
//if the pasword matches and they log in
       
TogglePlayerSpectating(playerid,false);
       
SetSpawnInfo(playerid,team,skin,X,Y,Z,FacingAngle,Gun1,Ammo1,Gun2,Ammo2,Gun3,Ammo3);
       
SpawnPlayer(playerid);
    }
    return 
1;

Sorry if this isn't what you were asking but I am pretty sure this will help you.
Reply
#3

This is what im using:
pawn Code:
case DIALOG_REGISTER:
        {
            if (!response) return Kick(playerid);
            if(response)
            {
// Register dialog
                if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, "Registering...","{FFFFFF}You have entered an {ADFF2F} invalid password.\n{FFFFFF}Type your password below to register a new account.","Register","Quit");
// Player File, Creating etc.
// Gender Dialog
                ShowPlayerDialog(playerid, DIALOG_SEX, DIALOG_STYLE_MSGBOX, "- Sex -","What gender are you?","Male","Female");
            }
        }
You can do the same thing with the Age dialog. And you can use SetSpawnInfo, TogglePlayerSpectating(playerid, 0) Turning off the spectating and SpawnPlayer(playerid)
Reply
#4

Thanks for your help - However , Found a better way to do it.
Reply
#5

Allright, No prob. Also im curious, what other way did you use?
BTW: I really liked your U-RP GM, Working on a V2?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)