SA-MP Forums Archive
Once again more garage 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: Once again more garage help (/showthread.php?tid=361114)



Once again more garage help - Ryan_Michael - 20.07.2012

Code
Код:
	if(IsPlayerInRangeOfPoint(playerid, 2, 2238.40,2191.07,103.94) || IsPlayerInRangeOfPoint(playerid, 2, 2259.6702,-1135.8542,1050.6328) || IsPlayerInRangeOfPoint(playerid, 2, 404.98,2457.82,16.50) // Garages
	{
 		new idx;
		idx = GetPlayerVirtualWorld(playerid)-500;
		if(!done && idx < MAX_GARAGES && GarageInfo[idx][gLevel])
		{
			format(string, sizeof(string), "* %s pushes the garage door button and exits the garage.", RPN(playerid));
			SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
	        SetPlayerPos(playerid, GarageInfo[idx][gX], GarageInfo[idx][gY], GarageInfo[idx][gZ]);
	        SetPlayerInterior(playerid, 0);
	        SetPlayerVirtualWorld(playerid, 0);
	        done = 1;
        }
	}
Error i get
Код:
C:\Users\Ryan Wharton\Desktop\zGaming Roleplay\gamemodes\ZRP.pwn(10986) : error 001: expected token: ")", but found "{"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.



Re: Once again more garage help - Kindred - 20.07.2012

Wrong:

pawn Код:
if(IsPlayerInRangeOfPoint(playerid, 2, 2238.40,2191.07,103.94) || IsPlayerInRangeOfPoint(playerid, 2, 2259.6702,-1135.8542,1050.6328) || IsPlayerInRangeOfPoint(playerid, 2, 404.98,2457.82,16.50) // Garages
{
Right:

pawn Код:
if(IsPlayerInRangeOfPoint(playerid, 2, 2238.40,2191.07,103.94) || IsPlayerInRangeOfPoint(playerid, 2, 2259.6702,-1135.8542,1050.6328) || IsPlayerInRangeOfPoint(playerid, 2, 404.98,2457.82,16.50)) // Garages
{
You forgot a ) at the end, this is what your doing:

pawn Код:
if(something(playerid, .....) || something(playerid, .....) //You see, I forgot a ) here as-well
Easy fix away!


Re: Once again more garage help - Ryan_Michael - 20.07.2012

Yep, That was it thank you. +rep