How can I create a weapon list?
#1

Like, for example.

pawn Код:
COMMAND:weapons(playerid, cmdtext)
{
 //I think it's ShowPlayerDialog but I'm not sure, what do I add here?
 return 1;
}
Thanks for your help in advance.
And by weapon list, I mean you do the command /weapons and a list of weapons pop up. Then you can choose one.
Reply
#2

Quote:
Originally Posted by rangerxxll
Посмотреть сообщение
Like, for example.

pawn Код:
COMMAND:weapons(playerid, cmdtext)
{
 //I think it's ShowPlayerDialog but I'm not sure, what do I add here?
 return 1;
}
Thanks for your help in advance.
And by weapon list, I mean you do the command /weapons and a list of weapons pop up. Then you can choose one.
pawn Код:
COMMAND:weapons(playerid, cmdtext)
{
    ShowPlayerDialog(playerid, 32, DIALOG_STYLE_LIST, "Pick a weapon:", "Weapon1\nWeapon2\nWeapon3", "Pick", "Close");
    return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == 32)
    {
        if(!response) return 1; // if he clicked the other button, stop the code
        switch(listitem) // Switch trough all list items
        {
            case 0:
            {
                // Give Weapon1
            }
            case 1:
            {
                // Give Weapon2
            }
            case 2:
            {
                // Give Weapon3
            }
        }
    }
    return 1;
}

EDIT: LoL, Las Venturas CNR posteb while I was writing
Reply
#3

I get.
Quote:

C:\Documents and Settings\Lucas\Desktop\MyTestServerV1.0\gamemodes\ testserver.pwn(86) : error 055: start of function body without function header
C:\Documents and Settings\Lucas\Desktop\MyTestServerV1.0\gamemodes\ testserver.pwn(89) : error 010: invalid function or declaration
C:\Documents and Settings\Lucas\Desktop\MyTestServerV1.0\gamemodes\ testserver.pwn(91) : error 010: invalid function or declaration
C:\Documents and Settings\Lucas\Desktop\MyTestServerV1.0\gamemodes\ testserver.pwn(93) : error 010: invalid function or declaration
C:\Documents and Settings\Lucas\Desktop\MyTestServerV1.0\gamemodes\ testserver.pwn(94) : error 010: invalid function or declaration
C:\Documents and Settings\Lucas\Desktop\MyTestServerV1.0\gamemodes\ testserver.pwn(95) : error 010: invalid function or declaration
C:\Documents and Settings\Lucas\Desktop\MyTestServerV1.0\gamemodes\ testserver.pwn(97) : error 010: invalid function or declaration
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


7 Errors.

Reply
#4

Quote:
Originally Posted by rangerxxll
Посмотреть сообщение
I get.
Copy "public OnDialogResponse(...)" from my script, and add to Las Venturas CNR's one, before "if(dialogid == ...)"
and at the end add a '}'
Reply
#5

Quote:
Originally Posted by [GF]Sasino97
Посмотреть сообщение
Copy "public OnDialogResponse(...)" from my script, and add to Las Venturas CNR's one, before "if(dialogid == ...)"
and at the end add a '}'
It compiled, but for
pawn Код:
case 0:
            {
                // Give Weapon1
            }
            case 1:
            {
                // Give Weapon2
            }
            case 2:
            {
                // Give Weapon3
            }
I make //Give Weapon 3
pawn Код:
GivePlayerWeapon(playerid, 24, 100);
Right? And do that for all the weapons?
Reply
#6

Quote:
Originally Posted by rangerxxll
Посмотреть сообщение
It compiled, but for
pawn Код:
case 0:
            {
                // Give Weapon1
            }
            case 1:
            {
                // Give Weapon2
            }
            case 2:
            {
                // Give Weapon3
            }
I make //Give Weapon 3
pawn Код:
GivePlayerWeapon(playerid, 24, 100);
Right? And do that for all the weapons?
Yes, It was an example. You can get weapon IDs and much more by downloading this https://sampforum.blast.hk/showthread.php?tid=35399
Reply
#7

Quote:
Originally Posted by [GF]Sasino97
Посмотреть сообщение
Yes, It was an example. You can get weapon IDs and much more by downloading this https://sampforum.blast.hk/showthread.php?tid=35399
Thank you for your help dude, I appreciate it.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)