SA-MP Forums Archive
Simple bit of help please! - 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: Simple bit of help please! (/showthread.php?tid=330877)



Simple bit of help please! - Scripter12345 - 02.04.2012

This should work


Код:
CMD:closegate(playerid, params[])
         {
       		MoveObject(lspdgate1, 1550.80004883,-1627.59997559,15.19999981, 1);
         	SendClientMessage(playerid, 0xFF8000FF, "The gate is closed.");
         	}
  Line 875:   else
         	{
  			SendClientMessage(playerid, 0xFF8000FF, "to far away.");
  			}
But im getting this error


Код:
(875) : error 010: invalid function or declaration
Please Help


Re: Simple bit of help please! - park4bmx - 02.04.2012

pawn Код:
CMD:closegate(playerid, params[])
         {
                If(!IsPlayerInRangeOfPoint(playerid,10,0,0,0)) return SendClientMessage(playerid, 0xFF8000FF, "to far away.");//change to the gates position !
            MoveObject(lspdgate1, 1550.80004883,-1627.59997559,15.19999981, 1);
            SendClientMessage(playerid, 0xFF8000FF, "The gate is closed.");
            }



Re: Simple bit of help please! - Catalyst- - 02.04.2012

Try this...
Код:
CMD:closegate(playerid, params[])
 {
	if(IsPlayerInRangeOfPoint(playerid, RANGE, 1550.80004883, -1627.59997559, 15.19999981))
	{
		MoveObject(lspdgate1, 1550.80004883, -1627.59997559, 15.19999981, 1);
		SendClientMessage(playerid, 0xFF8000FF, "The gate is closed.");
		return 1;
	}
	else return SendClientMessage(playerid, 0xFF8000FF, "to far away.");
}