[HELP]What is wrong? - 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: [HELP]What is wrong? (
/showthread.php?tid=114699)
[HELP]What is wrong? -
breakpaper - 20.12.2009
What is wrong with this?
the dialog:
pawn Код:
ShowPlayerDialog(playerid,1,DIALOG_STYLE_LIST,"Job List","Kidnapper\nCar Jacker\nDrugs Dealer","Ok","Cancel");
the OnDialogResponse:
pawn Код:
if(dialogid == 1)
{
if(!response){SendClientMessage(playerid, COLOR_RED, "You canceled! typ /chosejob for chose your job another time");
new message[196];
format(message,sizeof(message), "Your job is now %s", inputtext);
SendClientMessage(playerid, COLOR_BLUE, message);
if(listitem == 1)
{
PlayerInfo[playerid][pJob] = 3;
}
if(listitem == 2)
{
PlayerInfo[playerid][pJob] = 4;
}
if(listitem == 3)
{
PlayerInfo[playerid][pJob] = 5;
}
}
Re: [HELP]What is wrong? -
Martin_M - 20.12.2009
Listitem's start till starts from 0. So, first option is
listitem == 0
Код:
if(listitem == 0)
{
// Kidnapper
}
if(listitem == 1)
{
// Car jacker
}
if(listitem == 2)
{
// Drugs dealer
}