COMMAND:weapons(playerid, cmdtext)
{
//I think it's ShowPlayerDialog but I'm not sure, what do I add here?
return 1;
}
Like, for example.
pawn Код:
And by weapon list, I mean you do the command /weapons and a list of weapons pop up. Then you can choose one. |
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;
}
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. |
Copy "public OnDialogResponse(...)" from my script, and add to Las Venturas CNR's one, before "if(dialogid == ...)"
and at the end add a '}' |
case 0:
{
// Give Weapon1
}
case 1:
{
// Give Weapon2
}
case 2:
{
// Give Weapon3
}
GivePlayerWeapon(playerid, 24, 100);
It compiled, but for
pawn Код:
pawn Код:
|
Yes, It was an example. You can get weapon IDs and much more by downloading this https://sampforum.blast.hk/showthread.php?tid=35399
|