SA-MP Forums Archive
Paintball help - 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)
+--- Thread: Paintball help (/showthread.php?tid=465442)



Paintball help - DamonD - 22.09.2013

Hello, I have a good paintball system in my game-mode but no actual way to get into the game or anything... This is my command to show the dialog...

Код:
CMD:paintball(playerid, params[])
{
		if (IsPlayerInRangeOfPoint(playerid,3,1038.08, -3.98, 1001.28))
		{
			ShowPlayerDialog(playerid, PBMAINMENU, DIALOG_STYLE_LIST, "Paintball","Choose Arena/Set-Up\Purhcase tokens\nPaintball", "Select", "Cancel");
		}
		else
		{
			SendClientMessageEx(playerid, COLOR_WHITE, "You aren't in range of the paintball waiting room.. ");
		}
	}
	return 1;
}
This is that dialog "PBMAINMENU"

Код:
if(dialogid == PBMAINMENU) // Paintball Arena System
	{
		if(response == 1)
		{
		    switch(listitem)
		    {
		        case 0: // Choose a Arena
		        {
		            PaintballArenaSelection(playerid);
		        }
		        case 1: // Buy Paintball Tokens
		        {
		            PaintballTokenBuyMenu(playerid);
		        }
		        case 2:
		        {
		            if(PlayerInfo[playerid][pAdmin] >= 1337)
		            {
		            	PaintballAdminMenu(playerid);
					}
					else
					{
					    PaintballMainMenu(playerid);
					    SendClientMessageEx(playerid, COLOR_GRAD2, "You do not have authorization to access the admin panel.");
					    return 1;
					}
		        }
		    }
		}
	}
And the errors....

Код:
error 027: invalid character constant
error 027: invalid character constant
error 010: invalid function or declaration



Re: Paintball help - DanishHaq - 22.09.2013

pawn Код:
Choose Arena/Set-Up\Purhcase tokens\nPaintball
to

pawn Код:
Choose Arena/Set-Up\nPurhcase tokens\nPaintball
You missed the character "n" after the forward slash and the letter P in the world Purchase.

So, this is correct:

pawn Код:
ShowPlayerDialog(playerid, PBMAINMENU, DIALOG_STYLE_LIST, "Paintball","Choose Arena/Set-Up\nPurhcase tokens\nPaintball", "Select", "Cancel");



Re: Paintball help - DamonD - 22.09.2013

Now

Код:
CMD:paintball(playerid, params[])
{
		if (IsPlayerInRangeOfPoint(playerid,3,1038.08, -3.98, 1001.28))
		{
			ShowPlayerDialog(playerid, PBMAINMENU, DIALOG_STYLE_LIST, "Paintball","Choose Arena/Set-Up\nPurhcase tokens\nPaintball", "Select", "Cancel");
		}
		else
		{
			SendClientMessageEx(playerid, COLOR_WHITE, "You aren't in range of the paintball waiting room.. ");
		}
	}
	return 1;
}
Errors...

Код:
error 010: invalid function or declaration
Thats on the line "Return; 1".


Re: Paintball help - JimmyCh - 22.09.2013

pawn Код:
CMD:paintball(playerid, params[])
{
        if (IsPlayerInRangeOfPoint(playerid,3,1038.08, -3.98, 1001.28))
        {
            ShowPlayerDialog(playerid, PBMAINMENU, DIALOG_STYLE_LIST, "Paintball","Choose Arena/Set-Up\nPurhcase tokens\nPaintball", "Select", "Cancel");
        }
        else return SendClientMessageEx(playerid, COLOR_WHITE, "You aren't in range of the paintball waiting room.. ");
}



Re: Paintball help - DanishHaq - 22.09.2013

If as above doesn't work, show us the line that the error is occurring on.