SA-MP Forums Archive
How to make this dialog show - 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: How to make this dialog show (/showthread.php?tid=370750)



How to make this dialog show - NinjaChicken - 21.08.2012

ok when a player registers he is givem my default skin ID 217 and i want it so when he spawns for the first time a dialog shows up allowing him to enter a skin ID that he wants and it will save to his account

it must use this to save [pModel] plz help


Re: How to make this dialog show - Jack_Leslie - 21.08.2012

pawn Код:
public OnPlayerSpawn(playerid)
{
    ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT, "Select your skin", "Please input the Skin ID you wish to use", "Select", "");
    return 1;
}
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == 1) {
        if(response)
        {
            new skinid = strval(inputtext);
            if(!skinid) {
                ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT, "Select your skin", "Please input the Skin ID you wish to use", "Select", "");
            }
            else
            {
                if(skinid < 0 || skinid > 299) {
                    ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT, "Select your skin", "Please input the Skin ID you wish to use\nHint: Skin IDs range from 0 - 299", "Select", "");
                }
                else
                {
                    SetPlayerSkin(playerid, skinid);
                    PlayerInfo[playerid][pModel] = skinid;
                }
            }
        }
        else
        {
            ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT, "Select your skin", "Please input the Skin ID you wish to use", "Select", "");
        }
        return 1;
    }
    return 1;
}
You'll have to change the dialogid according to your script.


Re: How to make this dialog show - NinjaChicken - 21.08.2012

but wont that make it so every time he dies then spawns or relogs it will show every tiem?


Re: How to make this dialog show - JaKe Elite - 21.08.2012

Create a global variable.
OnPlayerConnect set the global variable to 0. onplayerdisconnect too.
then check if the global variable 0 onplayerspawn. if 0, then show the dialog.
if its not 0 then don't make it show.


Re: How to make this dialog show - Jack_Leslie - 21.08.2012

Make a check then.

At the top of your script:
pawn Код:
new gHasPlayerChosenSkin[MAX_PLAYERS];
Then have this for OnPlayerSpawn:
pawn Код:
public OnPlayerSpawn(playerid)
{
    if(!gHasPlayerChosenSkin[playerid]) {
        gHasPlayerChosenSkin[playerid] = 1;
        ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT, "Select your skin", "Please input the Skin ID you wish to use", "Select", "");
    }
    return 1;
}
Edit: As said above ^


Re: How to make this dialog show - _Vortex - 21.08.2012

Make their skin save in their user file and when they spawn just get their saved skin and set it.

edit you guys beat me to it


Re: How to make this dialog show - NinjaChicken - 21.08.2012

damn it, it bugs the fuck out of my tut system

i have this cmd
pawn Код:
CMD:start(playerid, params[])
{
    if(InsideTut[playerid] < 1)
    {
        SendClientMessageEx(playerid, COLOR_WHITE, "You can't use the command outside the tutorial.");
        return 1;
    }
its a edited NGRP script and i want it so after they type /start to spawn the dialog shows up not before anyone help?


Re: How to make this dialog show - Jack_Leslie - 21.08.2012

If it's an NGRP script then anyone would be stupid to help you.