Dialog help ...
#1

I wan't to know, how to make that dialog like, you choose something in DIALOG_STYLE_LIST , after that come (Now i say, what i need) DIALOG_STYLE_INPUT and i can type there id and then that ppl get that thing. Like, if i choose "Zombie" then come INPUT dialog and i type there id and then that man is "Zombie" !
Reply
#2

This Try this
Reply
#3

The command
pawn Код:
if(!strcmp("/dialogtestlist", cmdtext, true))
    {
        return ShowPlayerDialog(playerid,1234,DIALOG_STYLE_LIST,"Select a thing","Zombie","Ok","Exit");
    }
The response

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == 1234)
    {
        if(response)
        {
            switch(listitem)
            {
                case 0:///Zombie
                {
                    ShowPlayerDialog(playerid,5678,DIALOG_STYLE_INPUT,"Select a Player","Insert Playerid","Ok","Exit");
                }
            }
        }
    }
    if(dialogid == 5678)
    {
        if(response)
        {
            new name[MAX_PLAYER_NAME],string[128];
            if(!strlen(inputtext)) return SendClientMessage(playerid, 0x0000D9AA, "Insert a playerid");
            if(!isNumeric(inputtext)) return SendClientMessage(playerid, 0x0000D9AA, "Only numbers");
            if(!IsPlayerConnected(strval(inputtext)) return SendClientMessage(playerid, 0x0000D9AA, "This player is not online");
            GetPlayerName(strval(inputtext),name,sizeof(name));
            format(string,sizeof(string),"%s is now a zombie!",name);
            SendClientMessageToAll(0x0000D9AA,string);
        }
    }
    return 1;
}

not tested but you can understand
Reply
#4

Quote:
Originally Posted by [ISS]jumbo
Посмотреть сообщение
The command
pawn Код:
if(!strcmp("/dialogtestlist", cmdtext, true))
    {
        return ShowPlayerDialog(playerid,1234,DIALOG_STYLE_LIST,"Select a thing","Zombie","Ok","Exit");
    }
The response

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == 1234)
    {
        if(response)
        {
            switch(listitem)
            {
                case 0:///Zombie
                {
                    ShowPlayerDialog(playerid,5678,DIALOG_STYLE_INPUT,"Select a Player","Insert Playerid","Ok","Exit");
                }
            }
        }
    }
    if(dialogid == 5678)
    {
        if(response)
        {
            new name[MAX_PLAYER_NAME],string[128];
            if(!strlen(inputtext)) return SendClientMessage(playerid, 0x0000D9AA, "Insert a playerid");
            if(!isNumeric(inputtext)) return SendClientMessage(playerid, 0x0000D9AA, "Only numbers");
            if(!IsPlayerConnected(strval(inputtext)) return SendClientMessage(playerid, 0x0000D9AA, "This player is not online");
            GetPlayerName(strval(inputtext),name,sizeof(name));
            format(string,sizeof(string),"%s is now a zombie!",name);
            SendClientMessageToAll(0x0000D9AA,string);
        }
    }
    return 1;
}

not tested but you can understand
Thnx Its work !
Reply
#5

pawn Код:
if(dialogid == 7001)
    {
        if(response)
        {
            if(!strlen(inputtext)) return SendClientMessage(playerid, 0x0000D9AA, "Insert a player id");
            if(!isNumeric(inputtext)) return SendClientMessage(playerid, 0x0000D9AA, "Only numbers");
            if(!IsPlayerConnected(strval(inputtext)) return SendClientMessage(playerid, 0x0000D9AA, "This player is not online");
            new string[256];
            new PlayerName[MAX_PLAYER_NAME];
            GetPlayerName(playerid,PlayerName,sizeof(PlayerName));
            format(string,sizeof(string),"Admin %s {3333FF}has make | NEW CHAINSAW ZOMBIE |!{663333} Watch color on map!",PlayerName);
            SendClientMessageToAll(COLOR_LIGHTBLUE,string);
            format(string, sizeof(string), "~w~We have ~b~new~y~[]CHAINSAW ZOMBIE]");
            GameTextForAll( string, 5000, 3 );
            ResetPlayerWeapons(strlen(inputtext));
            GivePlayerWeapon(strlen(inputtext), 9, 999);
            Zombie[ strlen(inputtext) ] = Create3DTextLabel("{33FF66}I'M{FF3300} CHAINSAW {6633FF}ZOMBIE.",-1,30.0,40.0,50.0,40.0,0);
            Attach3DTextLabelToPlayer( Zombie[ strlen(inputtext) ], strlen(inputtext), 0.0, 0.0, 0.7);
            SetPlayerHealth(strlen(inputtext), 999);
            SetPlayerColor(strlen(inputtext), 0xFF6600AA);
            SetPlayerSkin(strlen(inputtext), 137);
            Delete3DTextLabel( Knife[ strlen(inputtext) ] );
            Delete3DTextLabel( Dildo[ strlen(inputtext) ] );
            Delete3DTextLabel( Shovel[ strlen(inputtext) ] );
        }
    }
Dont work, he make only id 0 if i type id 2, then he make only 0 ... and that line
pawn Код:
if(!IsPlayerConnected(strval(inputtext)) return SendClientMessage(playerid, 0x0000D9AA, "This player is not online");
Is that error
Код:
C:........pwn(644) : error 001: expected token: ")", but found "return"
Can Some1 help plz ?
Reply
#6

pawn Код:
if(!IsPlayerConnected(strval(inputtext)))
Try that
Reply
#7

Quote:
Originally Posted by xir
Посмотреть сообщение
pawn Код:
if(!IsPlayerConnected(strval(inputtext)))
Try that
Yea i know that, but if i type like my id (2) , then id 0 get that thing :S !
Reply
#8

idk if you can use sscanf in dialogs but you can try

pawn Код:
if(sscanf(params, "d", inputtext))
Instead of numeric

EDIT: I had a closer look, and I dont think the code I posted above work, but you can always give it a try
Reply
#9

If i make like command :
pawn Код:
COMMAND:zombiec(playerid, params[])
{
    if(ZombieS[playerid][Level] < 1) return SendClientMessage(playerid,Color_Red,"{990000}You need to be level 1 zombie to use this command !");
    new gsendid;
    new string[256];
    new PlayerName[MAX_PLAYER_NAME];
    GetPlayerName(playerid,PlayerName,sizeof(PlayerName));
    if(sscanf(params, "u",gsendid))return SendClientMessage(playerid,Color_Red, "Usage: {CC0099}/zombiec [ID]");
    else if(gsendid == INVALID_PLAYER_ID)return SendClientMessage(playerid, Color_Red, "{9999CC}Player not found!");
    else
    {
        format(string,sizeof(string),"Admin %s {3333FF}has make | NEW CHAINSAW ZOMBIE |!{663333} Watch color on map!",PlayerName);
        SendClientMessageToAll(COLOR_LIGHTBLUE,string);
        format(string, sizeof(string), "~w~We have ~b~new~y~[]CHAINSAW ZOMBIE]");
        GameTextForAll( string, 5000, 3 );
        ResetPlayerWeapons(gsendid);
        GivePlayerWeapon(gsendid, 9, 999);
        Zombie[ gsendid ] = Create3DTextLabel("{33FF66}I'M{FF3300} CHAINSAW {6633FF}ZOMBIE.",-1,30.0,40.0,50.0,40.0,0);
        Attach3DTextLabelToPlayer( Zombie[ gsendid ], gsendid, 0.0, 0.0, 0.7);
        SetPlayerHealth(gsendid, 999);
        SetPlayerColor(gsendid, 0xFF6600AA);
        SetPlayerSkin(gsendid, 137);
        Delete3DTextLabel( Knife[ gsendid ] );
        Delete3DTextLabel( Dildo[ gsendid ] );
        Delete3DTextLabel( Shovel[ gsendid ] );
    }
    return 1;
}
pawn Код:
if(dialogid == 7001)
    {
        if(response)
        {
            if(!strlen(inputtext)) return SendClientMessage(playerid, 0x0000D9AA, "Insert a player id");
            if(!isNumeric(inputtext)) return SendClientMessage(playerid, 0x0000D9AA, "Only numbers");
            else if(strlen(inputtext) == INVALID_PLAYER_ID)return SendClientMessage(playerid, Color_Red, "{9999CC}Player not found!");
            else
            {
                new string[256];
                new PlayerName[MAX_PLAYER_NAME];
                GetPlayerName(playerid,PlayerName,sizeof(PlayerName));
                format(string,sizeof(string),"Admin %s {3333FF}has make | NEW CHAINSAW ZOMBIE |!{663333} Watch color on map!",PlayerName);
                SendClientMessageToAll(COLOR_LIGHTBLUE,string);
                format(string, sizeof(string), "~w~We have ~b~new~y~[]CHAINSAW ZOMBIE]");
                GameTextForAll( string, 5000, 3 );
                ResetPlayerWeapons(strlen(inputtext));
                GivePlayerWeapon(strlen(inputtext), 9, 999);
                Zombie[ strlen(inputtext) ] = Create3DTextLabel("{33FF66}I'M{FF3300} CHAINSAW {6633FF}ZOMBIE.",-1,30.0,40.0,50.0,40.0,0);
                Attach3DTextLabelToPlayer( Zombie[ strlen(inputtext) ], strlen(inputtext), 0.0, 0.0, 0.7);
                SetPlayerHealth(strlen(inputtext), 999);
                SetPlayerColor(strlen(inputtext), 0xFF6600AA);
                SetPlayerSkin(strlen(inputtext), 137);
                Delete3DTextLabel( Knife[ strlen(inputtext) ] );
                Delete3DTextLabel( Dildo[ strlen(inputtext) ] );
                Delete3DTextLabel( Shovel[ strlen(inputtext) ] );
            }
        }
    }
Then its change only my things, like i type now id 0 and i am id 2 and then i be zombie ...
Reply
#10

Some1 can help ?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)