04.01.2012, 19:17
Can someone tell me where I went wrong?
This is OnDialogResponse:
This is the Defines (I find it easier):
The command:
EDIT: These are the errors now:
EDIT 2: updated the OnDialogResponse
This is OnDialogResponse:
Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { if(response == 12 && Dialogid == 12) { switch(listitem) { case 0: if(GetPlayerMoney(playerid) < 1000) return SendClientMessage(playerid, 0xFFFFFF, "You don't have enough cash."); GivePlayerMoney(playerid, -1000); GivePlayerWeapon(playerid, 24, 9999); SendClientMessage(Playerid, COLOR_YELLOW, "You have just bought a Desert Eagle for $1,000."); { else case 1: if(GetPlayerMoney(playerid) < 2200) return SendClientMessage(playerid, 0xFFFFFF, "You don't have enough cash."); GivePlayerMoney(playerid, -2200); GivePlayerWeapon(playerid, 31, 9999); SendClientMessage(playerid, COLOR_YELLOW, "You have just bought a M4A1 for $2,200."); else case 2: if(GetPlayerMoney(playerid) < 2500) return SendClientMessage(playerid, 0xFFFFFF, "You don't have enough cash."); GivePlayerMoney(playerid, -2500); GivePlayerWeapon(playerid, 27, 9999); SendClientMessage(playerid, COLOR_YELLOW, "You have just bought a Spas-12 for $2,500."); } return 1; }
Код:
#define DIALOG12_MSG "Desert Eagle\nM4A1\nSpas-12"
Код:
CMD:buygun(playerid, params[]) { ShowPlayerDialog(playerid, 12, DIALOG_STYLE_LIST, "Select what gun you want", DIALOG12_MSG, "Buy", "Cancel" ); return 1; }
Код:
C:\Users\Jordan\Desktop\Windows-Server\gamemodes\vx-rp.pwn(5512) : error 017: undefined symbol "Dialogid" C:\Users\Jordan\Desktop\Windows-Server\gamemodes\vx-rp.pwn(5518) : error 002: only a single statement (or expression) can follow each "case" C:\Users\Jordan\Desktop\Windows-Server\gamemodes\vx-rp.pwn(5518) : warning 215: expression has no effect C:\Users\Jordan\Desktop\Windows-Server\gamemodes\vx-rp.pwn(5520) : error 017: undefined symbol "Playerid" C:\Users\Jordan\Desktop\Windows-Server\gamemodes\vx-rp.pwn(5522) : error 029: invalid expression, assumed zero C:\Users\Jordan\Desktop\Windows-Server\gamemodes\vx-rp.pwn(5522 -- 5523) : warning 215: expression has no effect C:\Users\Jordan\Desktop\Windows-Server\gamemodes\vx-rp.pwn(5523) : error 001: expected token: ";", but found "case" C:\Users\Jordan\Desktop\Windows-Server\gamemodes\vx-rp.pwn(5523) : warning 217: loose indentation C:\Users\Jordan\Desktop\Windows-Server\gamemodes\vx-rp.pwn(5523) : error 014: invalid statement; not in switch C:\Users\Jordan\Desktop\Windows-Server\gamemodes\vx-rp.pwn(5523) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 7 Errors.