SA-MP Forums Archive
Dialog - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Dialog (/showthread.php?tid=167875)



Dialog - iLcke - 14.08.2010

im kinda new to dialogs so eh, yeah;
Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(response)
{
switch(dialogid)
{
case 1:
{
switch(listitem)
{
case 0:
{
SetPlayerFightingStyle (playerid, FIGHT_STYLE_NORMAL);
PlayerInfo[playerid][pFight] = 1;
}
case 1:
{
if(GetPlayerMoney(playerid) < 3000) return SendClientMessage(playerid, 0xFFFFFF, "You don't have enough cash!");
GivePlayerMoney(playerid, -3000);
SetPlayerFightingStyle (playerid, FIGHT_STYLE_BOXING);
PlayerInfo[playerid][pFight] = 2;
BizzInfo[10][bTakings] += 3000;
}
case 2:
{
if(GetPlayerMoney(playerid) < 5000) return SendClientMessage(playerid, 0xFFFFFF, "You don't have enough cash!");
GivePlayerMoney(playerid, -5000);
SetPlayerFightingStyle (playerid, FIGHT_STYLE_KUNGFU);
PlayerInfo[playerid][pFight] = 3;
BizzInfo[10][bTakings] += 5000;
}
case 3:
{
if(GetPlayerMoney(playerid) < 3500) return SendClientMessage(playerid, 0xFFFFFF, "You don't have enough cash!");
GivePlayerMoney(playerid, -3500);
SetPlayerFightingStyle (playerid, FIGHT_STYLE_ELBOW);
PlayerInfo[playerid][pFight] = 4;
BizzInfo[10][bTakings] += 3500;
}
// Job Menu
if(response)
{
switch(2)
{
case 1:
{
switch(listitem)
{
case 0:
{
GameTextForPlayer(playerid, "You are now a Taxi Driver!~N~Type ~R~/job ~W~for more information", 5000, 3);
PlayerInfo[playerid][pJob] = 1;
TogglePlayerControllable(playerid, 1);
DisablePlayerCheckpoint(playerid);
gPlayerCheckpointStatus[playerid] = CHECKPOINT_NONE;
}
case 1:
{
SendClientMessage(playerid, COLOR_RED, "Sorry, this job is no longer available, please select another");
ShowMenuForPlayer(Jobmenu, playerid);
ShowPlayerDialog(playerid,2,DIALOG_STYLE_LIST,"Looking for a new job? Select one.","Taxi Driver\r\nCar Dealer\r\nTruck Driver\r\nGrave Digger\r\nPizza Boy","Get Job", "Cancel");
}
case 2:
{
GameTextForPlayer(playerid, "You are now a Truck Driver!~N~Type ~R~/job ~W~for more information", 5000, 3);
PlayerInfo[playerid][pJob] = 3;
TogglePlayerControllable(playerid, 1);
DisablePlayerCheckpoint(playerid);
gPlayerCheckpointStatus[playerid] = CHECKPOINT_NONE;
}
case 3:
{
GameTextForPlayer(playerid, "You are now a Grave Digger!~N~Type ~R~/job ~W~for more information", 5000, 3);
PlayerInfo[playerid][pJob] = 4;
TogglePlayerControllable(playerid, 1);
DisablePlayerCheckpoint(playerid);
gPlayerCheckpointStatus[playerid] = CHECKPOINT_NONE;
}
case 4:
{
GameTextForPlayer(playerid, "You are now a Pizza Boy!~N~Type ~R~/job ~W~for more information", 5000, 3);
PlayerInfo[playerid][pJob] = 5;
TogglePlayerControllable(playerid, 1);
DisablePlayerCheckpoint(playerid);
gPlayerCheckpointStatus[playerid] = CHECKPOINT_NONE;
}
}
}
}
return 1;
}
errors;
Код:
C:\Users\iLcke\Desktop\SA-MP2\gamemodes\Fart.pwn(23652) : error 002: only a single statement (or expression) can follow each "case"
C:\Users\iLcke\Desktop\SA-MP2\gamemodes\Fart.pwn(23652 -- 23653) : error 028: invalid subscript (not an array or too many subscripts): "response"
C:\Users\iLcke\Desktop\SA-MP2\gamemodes\Fart.pwn(23652 -- 23654) : error 001: expected token: "}", but found "switch"
C:\Users\iLcke\Desktop\SA-MP2\gamemodes\Fart.pwn(23652 -- 23654) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Ideas..?


Re: Dialog - iLcke - 14.08.2010

with that i still get errors.

Код:
C:\Users\iLcke\Desktop\SA-MP2\gamemodes\Fart.pwn(23616) : error 002: only a single statement (or expression) can follow each "case"
C:\Users\iLcke\Desktop\SA-MP2\gamemodes\Fart.pwn(23616 -- 23617) : error 028: invalid subscript (not an array or too many subscripts): "response"
C:\Users\iLcke\Desktop\SA-MP2\gamemodes\Fart.pwn(23616 -- 23618) : error 001: expected token: "}", but found "switch"
C:\Users\iLcke\Desktop\SA-MP2\gamemodes\Fart.pwn(23616 -- 23618) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Line; 23616
Код:
if(response)
Line; 23616 -- 23617
Код:
if(response)
{
Line; 23616 -- 23618
Код:
if(response)
{
switch(listitem)
same goes for the other error..
Line; 23616 -- 23618
Код:
if(response)
{
switch(listitem)



Re: Dialog - iLcke - 14.08.2010

I Still get 4 errors.


Re: Dialog - iLcke - 14.08.2010

*Bumped*


Re: Dialog - Daren_Jacobson - 14.08.2010

Indent your code and I will help.