#1

how can i use the input? i mean... can you give me an exemple? i know how to do with
switch(listitem) but how can i do that when he right something it do something? thx!
Reply
#2

Dialog input?
Reply
#3

Quote:
Originally Posted by Clive
Посмотреть сообщение
Dialog input?
yea
Reply
#4

Next time search in wiki

pawn Код:
if(!strcmp(cmdtext, "/chat", true))
{
    ShowPlayerDialog(playerid, 3, DIALOG_STYLE_INPUT, "Chat", "Type your chat input here.", "Submit", "Cancel");
    return 1;
}
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(response)// Checking if they pressed the first button, if so continue:
    {
    switch(dialogid)//if your using only one dialog this isn't needed but you never know.
        {
        case 1:// Our dialog
            {
            switch(listitem)// Checking which listitem was chosen
            {
                case 0: // The first item in the list
                {
                    if(GetPlayerMoney(playerid) < 1) return SendClientMessage(playerid, 0xFFFFFF, "You don't have enough cash.");
                    GivePlayerMoney(playerid, -1);
                    SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_SPRUNK);
                }
                case 1: // The second item in the list
                {
                    if(GetPlayerMoney(playerid) < 2) return SendClientMessage(playerid, 0xFFFFFF, "You don't have enough cash.");
                    GivePlayerMoney(playerid, -2);
                    SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_BEER);
                }
                case 2: // The third item in the list
                {
                    if(GetPlayerMoney(playerid) < 3) return SendClientMessage(playerid, 0xFFFFFF, "You don't have enough cash.");
                    GivePlayerMoney(playerid, -3);
                    SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_WINE);
                }
            }
            }
 
            case 2:// The new dialog
            {
                 ApplyAnimation(playerid,"BEACH","Lay_Bac_Loop",4.1,1,1,1,1,10);// This will let you "relax" for 10 seconds.
            }
            // Here we add new things...
            case 3:
            {
                 if(strlen(inputtext) > 0)
                 {
                     SendPlayerMessageToAll(playerid, inputtext);
                 }
                 else
                 {
                     SendClientMessage(playerid,0xFFFFFFAA,"Your input was too short.");
                 }
            }
            // Until here.
    }
    }
    return 1;
}
Reply
#5

I've created a /changeskin command with dialig input i hope it helpz

http://pawn.pastebin.com/HtYVymzf
Reply
#6

thx but i want to add money with the iput text so how can i do it?
PlayerInfo[playerid][BankMoney] + inputtext?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)