A question [simple to answer]
#1

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

Dialogs?
Reply
#3

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

DIALOG_STYLE_LIST
DIALOG_STYLE_INPUT
Reply
#4

What about checking the wiki?

https://sampwiki.blast.hk/

https://sampwiki.blast.hk/wiki/Dialog
Reply
#5

Yeah checked already it's not a dialog
Reply
#6

A menu?

Reply
#7

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

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

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

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


Forum Jump:


Users browsing this thread: 1 Guest(s)