/interiors incident
#1

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

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."); }
}
Reply
#3

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

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

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

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

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

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

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

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


Forum Jump:


Users browsing this thread: 1 Guest(s)