How to make this dialog show
#1

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
Reply
#2

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.
Reply
#3

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

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.
Reply
#5

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 ^
Reply
#6

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
Reply
#7

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?
Reply
#8

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


Forum Jump:


Users browsing this thread: 1 Guest(s)