25.06.2012, 20:18
hey guys im making my own idea named "addicting ciggy system" utineed some help :S im new in scripting :S look... i scripted it by using dialogs system(iused 2 dialogs so this one is the second dialog in the script) :
script:
and: (this one includes the 1st dialog too)
the error is:
how tofix it? please help me guys
script:
Code:
public OnPlayerCommandText(playerid, cmdtext[]) { if(!strcmp(cmdtext, "/ciggies", true)) { ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Buy ciggies", "Esse Black(10$)\nG1(10$)\nMacbeth(5$)\nMalboro(20$)\nWinston Light(50$)\nNicotine Stick(200000$)(it stops addicting to cigarettes)", "Buy", "Cancel"); return 1; } return CreateBox(playerid, "Error", "The command you entered is ~r~unknown ~w~! ~n~use /cmds to view the server commands."); }
Code:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { if(response) { case 1: { switch(listitem) { case 0: { PlayAudioStreamForPlayer(playerid,"http://listen.di.fm/public5/trance.asx",0.0, 0.0, 0.0, 50.0, 0); CreateBox(playerid, "Radio", "~r~Trance music ~w~radio activated!"); } case 1: { PlayAudioStreamForPlayer(playerid, "http://listen.di.fm/public5/harddance.asx", 0.0, 0.0, 0.0, 50.0, 0); CreateBox(playerid, "Radio", "~r~hard dance music ~w~radio activated!"); } case 2: { PlayAudioStreamForPlayer(playerid, "http://listen.di.fm/public5/dubstep.asx", 0.0, 0.0, 0.0, 50.0, 0); CreateBox(playerid, "Radio", "~r~Dubstep music ~w~radio activated!"); } case 3: { PlayAudioStreamForPlayer(playerid, "http://listen.di.fm/public5/djmixes.asx", 0.0, 0.0, 0.0, 50.0, 0); CreateBox(playerid, "Radio", "~r~DJ mixes music ~w~radio activated!"); } case 4: { StopAudioStreamForPlayer(playerid); CreateBox(playerid, "Radio", "~r~Radio ~w~have been stopped!"); } } case 2: { case 1: { if(GetPlayerMoney(playerid) < 10) return ShowPlayerDialog(playerid,1, DIALOG_STYLE_MSGBOX, "Error", "You dont have enough money to buy Esse Black cigarette!", "Okay", "Close"); GivePlayerMoney(playerid, -10); SetPlayerSpecialAction(playerid, SPECIAL_ACTION_SMOKE_CIGGY); } case 2: { if(GetPlayerMoney(playerid) < 10) return ShowPlayerDialog(playerid,1, DIALOG_STYLE_MSGBOX, "Error", "You dont have enough money to buy G1 cigarette!", "Okay", "Close"); GivePlayerMoney(playerid, -10); SetPlayerSpecialAction(playerid, SPECIAL_ACTION_SMOKE_CIGGY); } case 3: { if(GetPlayerMoney(playerid) < 5) return ShowPlayerDialog(playerid,1, DIALOG_STYLE_MSGBOX, "Error", "You dont have enough money to buy Macbeth cigarette!", "Okay", "Close"); GivePlayerMoney(playerid, -5); SetPlayerSpecialAction(playerid, SPECIAL_ACTION_SMOKE_CIGGY); } case 4: { if(GetPlayerMoney(playerid) < 20) return ShowPlayerDialog(playerid,1, DIALOG_STYLE_MSGBOX, "Error", "You dont have enough money to buy Malboro cigarette!", "Okay", "Close"); GivePlayerMoney(playerid, -20); SetPlayerSpecialAction(playerid, SPECIAL_ACTION_SMOKE_CIGGY); } case 5: { if(GetPlayerMoney(playerid) < 50) return ShowPlayerDialog(playerid,1, DIALOG_STYLE_MSGBOX, "Error", "You dont have enough money to buy Winstone Light cigarette!", "Okay", "Close"); GivePlayerMoney(playerid, -50); SetPlayerSpecialAction(playerid, SPECIAL_ACTION_SMOKE_CIGGY); } case 6: { if(GetPlayerMoney(playerid) < 200000) return ShowPlayerDialog(playerid,1, DIALOG_STYLE_MSGBOX, "Error", "You dont have enough money to buy Nicotine Sticks!", "Okay", "Close"); GivePlayerMoney(playerid, -200000); SetPlayerDrunkLevel(playerid, 0); } } } } return 1; }
Code:
C:\Users\XTC\Desktop\XTC 3.e\gamemodes\XTC.pwn(1450) : error 014: invalid statement; not in switch C:\Users\XTC\Desktop\XTC 3.e\gamemodes\XTC.pwn(1450) : warning 215: expression has no effect C:\Users\XTC\Desktop\XTC 3.e\gamemodes\XTC.pwn(1450) : error 001: expected token: ";", but found ":" C:\Users\XTC\Desktop\XTC 3.e\gamemodes\XTC.pwn(1450) : error 029: invalid expression, assumed zero C:\Users\XTC\Desktop\XTC 3.e\gamemodes\XTC.pwn(1450) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 4 Errors.