#1

How to make something similar? I just know how to make it as dialog but not like this..

Reply
#2

Those are textdraws.
Reply
#3

I know, i got the textdraw ready but how can i do so the player like a chastity belt if he choose #3 ?
Reply
#4

Do players need to click on the textdraws?

If so, create one textdraw per option.
And check which textdraw the players clicks upon using OnPlayerClickTextDraw or OnPlayerClickPlayerTextDraw and take action based on which textdraw was selected.
Reply
#5

When you show textdraw0, set Textdraw0[playerid] = 1;

OnPlayerText, check if players types 3 and if textdraw0[playerid] = 1 then give chasity belt.
it's quite easy actually.
Reply
#6

You dont need to click, the player needs to type a number to get a item, but it'll need to check his money first, and if he types a invalid number he will get like "Invalid option"
Reply
#7

Ideas?
Reply
#8

Bump
Reply
#9

when the player types a numer in the textbox, check if the dialog is being shown to the player.

if it is, check what number the player typed.

get the info from either an array, or use a static way to script it.

check if the player has the certain amount of money, or more than that.

something like

pawn Код:
enum E_TEXT_DATA
{
    tName[ 35 ],
    tAmount
}

new TextData[ 5 ][ E_TEXT_DATA ] =
{
    { "Adrenaline Pill", 75000 },
    { "Drugs 50g", 10000 },
    { "Chastity Belt", 15000 },
    { "Weapons", 0 },
    { "Fighting Style", 20000 }
};

public OnPlayerText(playerid, text[])
{
    if( /* check if the textdraw box is shown */ )
    {
        new Number = ( text[ 0 ] -1 );
        if( GetPlayerMoney( playerid ) >= TextData[ Number ][ tAmount ] )
        {
            GivePlayerMoney( playerid, -TextData[ Number ][ tAmount ] );
            // give the items here.
        }
        else SendClientMessage( playerid, -1, "You haven't got enough money to purchase this item!" );
    }
    return 1;
}
Reply
#10

Quote:
Originally Posted by Ananisiki
Посмотреть сообщение
I know, i got the textdraw ready but how can i do so the player like a chastity belt if he choose #3 ?
pawn Код:
public OnPlayerText(playerid, text[])
{
    if(ShowingTextdraw[playerid] == true)
    {
        if(strval(text) == 1)
        {
            //your actions
            return 0; //return to 0 always
        }
        if(strval(text) == 2)
        {
            //your actions
            return 0;
        }
        if(strval(text) == 3)
        {
            //your actions
            return 0;
        }
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)