public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { if(dialogid == 2){ if(response){ switch(listitem)){ case 0: { //Selected Item: "/boatstunt" } else{ //The player has pressed "ok". switch(listitem{ case 0: { //Selected Item: "/boatstunt" } return 0; }
F:\program files\my own drifting gamemode\filterscripts\CMDS.pwn(38) : error 001: expected token: "{", but found ")" F:\program files\my own drifting gamemode\filterscripts\CMDS.pwn(39) : error 014: invalid statement; not in switch F:\program files\my own drifting gamemode\filterscripts\CMDS.pwn(39) : warning 215: expression has no effect F:\program files\my own drifting gamemode\filterscripts\CMDS.pwn(39) : error 001: expected token: ";", but found ":" F:\program files\my own drifting gamemode\filterscripts\CMDS.pwn(39) : error 029: invalid expression, assumed zero F:\program files\my own drifting gamemode\filterscripts\CMDS.pwn(39) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 5 Errors.
switch(listitem))
switch(listitem)
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 2)
{
if(response) /* if player press first button */
{
switch ( listitem )
{
case 0:
{
/* first item */
}
case 1:
{
/* second item */
}
/* and so on */
}
}
else
{
/* if player press second button */
}
}
return 0;
}
pawn Код:
|
ShowPlayerDialog(playerid, 2, DIALOG_STYLE_LIST, "Teleports", "/boatstunt\n/derby\n/8track\n/dirttrack\n/dirtcourt\n/ck1 carkiller team 1\n/ck2 car killer team 2\n/twintowerisland\n/dragrace\n/driftking\n/lvtune\n/lstune\n/sftune\n/arch\n/loco\n/kart\n/drift[1/3]\n/aa", "ok", "cancel"); public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { if(dialogid == 2){ if(response){ switch(listitem)){ case 0: { //Selected Item: "/boatstunt" } case 1: { //Selected Item: "/derby" } case 2: { //Selected Item: "/8track" } case 3: { //Selected Item: "/dirttrack" } case 4: { //Selected Item: "/dirtcourt" } case 5: { //Selected Item: "/ck1 carkiller team 1" } case 6: { //Selected Item: "/ck2 car killer team 2" } case 7: { //Selected Item: "/twintowerisland" } case 8: { //Selected Item: "/dragrace" } case 9: { //Selected Item: "/driftking" } case 10: { //Selected Item: "/lvtune" } case 11: { //Selected Item: "/lstune" } case 12: { //Selected Item: "/sftune" } case 13: { //Selected Item: "/arch" } case 14: { //Selected Item: "/loco" } case 15: { //Selected Item: "/kart" } case 16: { //Selected Item: "/drift[1/3]" } case 17: { //Selected Item: "/aa" } } else{ //The player has pressed "ok". switch(listitem{ case 0: { //Selected Item: "/boatstunt" } case 1: { //Selected Item: "/derby" } case 2: { //Selected Item: "/8track" } case 3: { //Selected Item: "/dirttrack" } case 4: { //Selected Item: "/dirtcourt" } case 5: { //Selected Item: "/ck1 carkiller team 1" } case 6: { //Selected Item: "/ck2 car killer team 2" } case 7: { //Selected Item: "/twintowerisland" } case 8: { //Selected Item: "/dragrace" } case 9: { //Selected Item: "/driftking" } case 10: { //Selected Item: "/lvtune" } case 11: { //Selected Item: "/lstune" } case 12: { //Selected Item: "/sftune" } case 13: { //Selected Item: "/arch" } case 14: { //Selected Item: "/loco" } case 15: { //Selected Item: "/kart" } case 16: { //Selected Item: "/drift[1/3]" } case 17: { //Selected Item: "/aa" } } } return 0; }
ShowPlayerDialog(playerid, 2, DIALOG_STYLE_LIST, "Teleports", "/boatstunt\n/derby\n/8track\n/dirttrack\n/dirtcourt\n/ck1 carkiller team 1\n/ck2 car killer team 2\n/twintowerisland\n/dragrace\n/driftking\n/lvtune\n/lstune\n/sftune\n/arch\n/loco\n/kart\n/drift[1/3]\n/aa", "ok", "cancel");
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if ( dialogid == 2 )
{
/* if second button pressed */
if ( !response ) return SendClientMessage( playerid, -1, #You have canceled );
/* if first button pressed */
if ( response )
{
switch ( listitem )
{
case 0:
{
//Selected Item: "/boatstunt"
}
case 1:
{
//Selected Item: "/derby"
}
case 2:
{
//Selected Item: "/8track"
}
case 3:
{
//Selected Item: "/dirttrack"
}
case 4:
{
//Selected Item: "/dirtcourt"
}
case 5:
{
//Selected Item: "/ck1 carkiller team 1"
}
case 6:
{
//Selected Item: "/ck2 car killer team 2"
}
case 7:
{
//Selected Item: "/twintowerisland"
}
case 8:
{
//Selected Item: "/dragrace"
}
case 9:
{
//Selected Item: "/driftking"
}
case 10:
{
//Selected Item: "/lvtune"
}
case 11:
{
//Selected Item: "/lstune"
}
case 12:
{
//Selected Item: "/sftune"
}
case 13:
{
//Selected Item: "/arch"
}
case 14:
{
//Selected Item: "/loco"
}
case 15:
{
//Selected Item: "/kart"
}
case 16:
{
//Selected Item: "/drift[1/3]"
}
case 17:
{
//Selected Item: "/aa"
}
}
}
}
return 0;
}