Problem with a dialog for getting guns need help
#1

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.
Reply
#2

Does anyone know how I can fix this?
Reply
#3

Write 303 - 306 lines, I will fix them
Reply
#4

Код:
	return 1;
}

CMD:heal(playerid, params[])
Reply
#5

line 303 - delete one or two tabs
line 306 - heal command not exists
Reply
#6

I just fixed it, all I had to do was close out a portion of the code.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)