Evo ovako, napravio sam List dialog za /weapons komanda i ovako to izgleda :
if (strcmp("/weapons", cmdtext, true, 10) == 0)
{
new listitems = "1Deagle2M43Mp5"
ShowPlayerDialog(playerid,3,DIALOG_STYLE_LIST, " Lista oruzja: ", listitems, "Uzmi", "Odustani");
return 1;
}
return 0;
}
I evo public OnDialogResponse :
if(dialogid == 3)
if(response)
if(listitem == 0)
GivePlayerWeapon (playerid, 24, 500);
return 1;
}
I sad mi daje ova dva errora :
D:\Folder\Pawno\GameModes\Mafia II\gamemodes\Untitled.pwn(93 -- 94) : error 033: array must be indexed (variable "-unknown-")
D:\Folder\Pawno\GameModes\Mafia II\gamemodes\Untitled.pwn(94) : error 035: argument type mismatch (argument 5)
if (strcmp("/weapons", cmdtext, true, 10) == 0)
{
ShowPlayerDialog(playerid,3,DIALOG_STYLE_LIST, " Lista oruzja: ", "Eagle\nM4\nMp5", "Uzmi", "Odustani");
return true;
}
if(dialogid == 3 && response)
{
switch(listitem)
{
case 0:
{
GivePlayerWeapon (playerid, 24, 500);
}
}
.
.
.
.
Sad ovo izbaci
D:\Folder\Pawno\GameModes\Mafia II\gamemodes\Untitled.pwn(538) : error 002: only a single statement (or expression) can follow each "case"
Citat: Dereck poslato Januar 08, 2011, 15:24:29 POSLE PODNE
Sad ovo izbaci
D:\Folder\Pawno\GameModes\Mafia II\gamemodes\Untitled.pwn(538) : error 002: only a single statement (or expression) can follow each "case"
umjesto case probaj staviti
if(listitem == 0) // za Eagle
{
}
if(listitem == 1) //za m4
{
}
if(listitem == 2)// za mp5
{
}