SA-MP Forums Archive
A question [simple to answer] - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: A question [simple to answer] (/showthread.php?tid=179958)



A question [simple to answer] - Shockey - 29.09.2010

Ok I have been playing crazybobs cops and robbers and I want to make a thing where say if ur buying weaps from a person say the cmd is /ws then it cones up with this box thingo and it says a number and stuff like

1. Silenced Pistol $1000
2. Desert Eagle $2500

etc and when you type 2 yeah get a desert eagle.
Does anyone know what that thing is called If you do if u know a tut on it can u plz give me a link

-Thankyou


Re: A question [simple to answer] - Cameltoe - 29.09.2010

Dialogs?


Re: A question [simple to answer] - Shockey - 29.09.2010

hmm what's the other type of dialog called I know

DIALOG_STYLE_LIST
DIALOG_STYLE_INPUT


Re: A question [simple to answer] - Cameltoe - 29.09.2010

What about checking the wiki?

https://sampwiki.blast.hk/

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


Re: A question [simple to answer] - Shockey - 29.09.2010

Yeah checked already it's not a dialog


Re: A question [simple to answer] - rbN. - 29.09.2010

A menu?




Re: A question [simple to answer] - [XST]O_x - 29.09.2010

As I know CrazyBob's server, they're using textdraws, and then detecting if a player is seeing a certain textdraw, and writing one of the numbers that on it.

Example
pawn Code:
new Text: test;
new bool:IsSeeing[MAX_PLAYERS];

public OnGameModeInit()
{
    test = TextDrawCreate(x,y,"~y~1 ~w~This is item 1~n~~y~2 ~w~ this is item 2 ~n~~y~3 ~w~this is item 3");
    More textdraw info here
    return 1;
}

public OnPlayerEnter24/7store(playerid,24/7storeid) // Randomized as possible
{
    TextDrawShowForPlayer(playerid,test);
    IsSeeing[playerid] == true;
    return 1;
}

public OnPlayerText(playerid, text[])
{
    if(text[0] == '1' && IsSeeing[playerid] == true)
    {
        SendClientMessage(playerid,0x00,"You've chose item 1!");
        IsSeeing[playerid] = false;
        TextDrawHideForPlayer(playerid,test);
        return 0; //So everyone won't see he wrote '1'.
    }
    if(text[0] == '2' && IsSeeing[playerid] == true)
    {
        SendClientMessage(playerid,0x00,"You've chose item 2!");
        IsSeeing[playerid] = false;
        TextDrawHideForPlayer(playerid,test);
        return 0;
    }
    return 1;
}

//ETC.
Got that?


Re: A question [simple to answer] - Scenario - 29.09.2010

Quote:
Originally Posted by [XST]O_x
View Post
As I know CrazyBob's server, they're using textdraws, and then detecting if a player is seeing a certain textdraw, and writing one of the numbers that on it.

Example
pawn Code:
new Text: test;
new bool:IsSeeing[MAX_PLAYERS];

public OnGameModeInit()
{
    test = TextDrawCreate(x,y,"~y~1 ~w~This is item 1~n~~y~2 ~w~ this is item 2 ~n~~y~3 ~w~this is item 3");
    More textdraw info here
    return 1;
}

public OnPlayerEnter24/7store(playerid,24/7storeid) // Randomized as possible
{
    TextDrawShowForPlayer(playerid,test);
    IsSeeing[playerid] == true;
    return 1;
}

public OnPlayerText(playerid, text[])
{
    if(text[0] == '1' && IsSeeing[playerid] == true)
    {
        SendClientMessage(playerid,0x00,"You've chose item 1!");
        IsSeeing[playerid] = false;
        TextDrawHideForPlayer(playerid,test);
        return 0; //So everyone won't see he wrote '1'.
    }
    if(text[0] == '2' && IsSeeing[playerid] == true)
    {
        SendClientMessage(playerid,0x00,"You've chose item 2!");
        IsSeeing[playerid] = false;
        TextDrawHideForPlayer(playerid,test);
        return 0;
    }
    return 1;
}

//ETC.
Got that?
They are using text-draws and you have basically shown how to detect if a particular text-draw is opened or not.


Re: A question [simple to answer] - [XST]O_x - 29.09.2010

A dialog? Seriously?

I showed him how to detect if a player is seeing a textdraw, and writing the number '1' in the text box, which is basically what CBCNR does.


Re: A question [simple to answer] - Scenario - 29.09.2010

Quote:
Originally Posted by [XST]O_x
View Post
A dialog? Seriously?

I showed him how to detect if a player is seeing a textdraw, and writing the number '1' in the text box, which is basically what CBCNR does.
Sorry, wrong word. You're right though, it's the way it's done.