SA-MP Forums Archive
/interiors incident - 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: /interiors incident (/showthread.php?tid=492013)



/interiors incident - Ryan McDuff - 02.02.2014

Okay so the command is all set and ready but I'm having a little issue.

Код:
CMD:interiors(playerid,params[])
{
    if(PlayerInfo[playerid][pAdmin] >= 4)
    {
        new string[50];
        format(string, sizeof(string),"Your interior is %d.",GetPlayerInterior(playerid));
        ShowPlayerDialog(playerid, 2, 2, string,"BUTTON1","BUTTON2");
    }
    else { SendClientMessage(playerid,COLOR_GRAD1,"No authorization."); }
}
Quote:
How do I fix this?


Re: /interiors incident - TheFlyer - 02.02.2014

Quote:
Originally Posted by Ryan McDuff
Посмотреть сообщение
Okay so the command is all set and ready but I'm having a little issue.

Код:
CMD:interiors(playerid,params[])
{
    if(PlayerInfo[playerid][pAdmin] >= 4)
    {
        new string[50];
        format(string, sizeof(string),"Your interior is %d.",GetPlayerInterior(playerid));
        ShowPlayerDialog(playerid, 2, 2, string,"BUTTON1","BUTTON2");
    }
    else { SendClientMessage(playerid,COLOR_GRAD1,"No authorization."); }
}

How do I fix this?
use strcat

pawn Код:
CMD:interiors(playerid,params[])
{
    if(PlayerInfo[playerid][pAdmin] >= 4)
    {
        new string[50];
        strcat(string, "Your interior is %d.",GetPlayerInterior(playerid));
        ShowPlayerDialog(playerid, 2, DIALOG_STYLE_LIST, string,"BUTTON1","BUTTON2");
    }
    else { SendClientMessage(playerid,COLOR_GRAD1,"No authorization."); }
}



Re: /interiors incident - CuervO - 02.02.2014

Quote:
Originally Posted by TheFlyer
Посмотреть сообщение
use strcat

pawn Код:
CMD:interiors(playerid,params[])
{
    if(PlayerInfo[playerid][pAdmin] >= 4)
    {
        new string[50];
        strcat(string, "Your interior is %d.",GetPlayerInterior(playerid));
        ShowPlayerDialog(playerid, 2, DIALOG_STYLE_LIST, string,"BUTTON1","BUTTON2");
    }
    else { SendClientMessage(playerid,COLOR_GRAD1,"No authorization."); }
}
Wont work, he's formatting an interior id in his string;

@OP:

You're missing the caption[] argument, it comes right after type (yours is DIALOG_STYLE_LIST). With your code you're missing the last button and setting the caption as the string, the info[] as "BUTTON1", and button 1 as "BUTTON2"


Re: /interiors incident - Ryan McDuff - 02.02.2014

Quote:
Originally Posted by CuervO
Посмотреть сообщение
Wont work, he's formatting an interior id in his string;

@OP:

You're missing the caption[] argument, it comes right after type (yours is DIALOG_STYLE_LIST). With your code you're missing the last button and setting the caption as the string, the info[] as "BUTTON1", and button 1 as "BUTTON2"
Could you edit it and paste it here?


Re: /interiors incident - CuervO - 02.02.2014

Код:
ShowPlayerDialog(playerid, 2, 2,"Interior ID", string,"BUTTON1","BUTTON2");



Re: /interiors incident - Ryan McDuff - 02.02.2014

Quote:
Originally Posted by CuervO
Посмотреть сообщение
Код:
ShowPlayerDialog(playerid, 2, 2,"Interior ID", string,"BUTTON1","BUTTON2");
After doing that, when I type in the command the dialog pops up, but in the background it says "unknown command". Also how do I get my interiors into the dialog? This is what it looks like for me:

Also I want to be able to change the names of the buttons.


Re: /interiors incident - CuervO - 02.02.2014

Quote:
Originally Posted by Ryan McDuff
Посмотреть сообщение
After doing that, when I type in the command the dialog pops up, but in the background it says "unknown command". Also how do I get my interiors into the dialog? This is what it looks like for me:

Also I want to be able to change the names of the buttons.
I recommend reading this before going any further

https://sampwiki.blast.hk/wiki/ShowPlayerDialog


Re: /interiors incident - Ryan McDuff - 02.02.2014

Okay well I changed the button names, how do I add the interiors into the dialog?


Re: /interiors incident - CuervO - 02.02.2014

Quote:
Originally Posted by Ryan McDuff
Посмотреть сообщение
Okay well I changed the button names, how do I add the interiors into the dialog?
That is an odd question. What you scripted it to do is for it to display your current interior. What do you mean by "add more interiors"


Re: /interiors incident - Ryan McDuff - 02.02.2014

Quote:
Originally Posted by CuervO
Посмотреть сообщение
That is an odd question. What you scripted it to do is for it to display your current interior. What do you mean by "add more interiors"
-.-' The command is /interiors meaning I want the dialog to list all of the interior names so I can teleport to them.