Problem with a dialog for getting guns need help -
K9IsGodly - 01.01.2014
I was trying to make a command for getting guns that would open up a dialog. I'm using ZCMD. My problem is something I played around with all of last night and couldn't figure out. The actual command works because I took the OnDialogResponse bit out and I got no errors, so I don't understand what's wrong with the response of the dialog. Can someone tell me if I'm missing something obvious maybe?
Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 1)
{
if(response)
{
if(listitem == 0)
{
GivePlayerWeapon(playerid, 24, 99999999);
SendClientMessage(playerid, COLOR_RED, "You have been given a desert eagle!");
}
if(listitem == 1)
{
GivePlayerWeapon(playerid, 29, 99999999);
SendClientMessage(playerid, COLOR_RED, "You have been given an MP5!");
}
if(listitem == 2)
{
GivePlayerWeapon(playerid, 27, 99999999);
SendClientMessage(playerid, COLOR_RED, "You have been given a SPAS12!");
}
if(listitem == 3)
{
GivePlayerWeapon(playerid, 31, 99999999);
SendClientMessage(playerid, COLOR_RED, "You have been given an M4!");
}
if(listitem == 4)
{
GivePlayerWeapon(playerid, 34, 99999999);
SendClientMessage(playerid, COLOR_RED, "You have been given a sniper rifle!");
}
}
return 1;
}
Код:
CMD:getgun(playerid, params[])
{
if(IsPlayerConnected(playerid))
{
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Weapon Giving", "Deagle\nMP5\nSPAS12\nM4A1\nSniper", "Choose", "Decline");
}
else
{
SendClientMessage(playerid, COLOR_RED, "You need to be logged in to use that command!");
}
return 1;
}
Errors:
Код:
C:\Users\Nolan\Desktop\Scripting Stuff\Sa-Mp Pawn\Pawn Scripting\pawno\Roleplayscript.pwn(303) : warning 217: loose indentation
C:\Users\Nolan\Desktop\Scripting Stuff\Sa-Mp Pawn\Pawn Scripting\pawno\Roleplayscript.pwn(306) : warning 217: loose indentation
C:\Users\Nolan\Desktop\Scripting Stuff\Sa-Mp Pawn\Pawn Scripting\pawno\Roleplayscript.pwn(306) : error 029: invalid expression, assumed zero
C:\Users\Nolan\Desktop\Scripting Stuff\Sa-Mp Pawn\Pawn Scripting\pawno\Roleplayscript.pwn(306) : error 017: undefined symbol "cmd_heal"
C:\Users\Nolan\Desktop\Scripting Stuff\Sa-Mp Pawn\Pawn Scripting\pawno\Roleplayscript.pwn(306) : error 029: invalid expression, assumed zero
C:\Users\Nolan\Desktop\Scripting Stuff\Sa-Mp Pawn\Pawn Scripting\pawno\Roleplayscript.pwn(306) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
4 Errors.
Re: Problem with a dialog for getting guns need help -
K9IsGodly - 01.01.2014
Does anyone know how I can fix this?
Re: Problem with a dialog for getting guns need help -
Vykintas - 01.01.2014
Write 303 - 306 lines, I will fix them
Re: Problem with a dialog for getting guns need help -
K9IsGodly - 01.01.2014
Код:
return 1;
}
CMD:heal(playerid, params[])
Re: Problem with a dialog for getting guns need help -
Vykintas - 01.01.2014
line 303 - delete one or two tabs
line 306 - heal command not exists
Re: Problem with a dialog for getting guns need help -
K9IsGodly - 01.01.2014
I just fixed it, all I had to do was close out a portion of the code.