SA-MP Forums Archive
I have a bug with my /elevator command. - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: I have a bug with my /elevator command. (/showthread.php?tid=190306)



What is wrong with this command? - patfay - 14.11.2010

Well, I have a /elevator command for my PD. I have it set to a certain point inside the interior and outside the exterior. I can use /elevator inside the entire SF PD interior, and I can use it through the entire city for my RP server, which is Fort Carson.
I need it so you can only use it when you are near the set destination.

Here is my command

Код:
command(elevator, playerid, params[])
{
	#pragma unused params
	if(IsPlayerInRangeOfPoint(playerid, 2933, -218.80146790, 1007.80938721, 20.42116928) || IsPlayerInRangeOfPoint(playerid, 0, -218.832098, 984.969726, 19.158166))
{
		if(Groups[Player[playerid][Group]][CommandTypes] == 1 || Groups[Player[playerid][Group]][CommandTypes] == 4)
	    {
			ShowPlayerDialog(playerid, 3928, DIALOG_STYLE_LIST, "Elevator", "Vehicles\nInterior", "Select", "Cancel");
		}
	}
	return 1;
}



Re: I have a bug with my /elevator command. - Camacorn - 14.11.2010

Try this:

Код:
command(elevator, playerid, params[])
{
	#pragma unused params
	if(IsPlayerInRangeOfPoint(playerid, 5, -218.80146790, 1007.80938721, 20.42116928) || IsPlayerInRangeOfPoint(playerid, 5, -218.832098, 984.969726, 19.158166))
{
		if(Groups[Player[playerid][Group]][CommandTypes] == 1 || Groups[Player[playerid][Group]][CommandTypes] == 4)
	    {
			ShowPlayerDialog(playerid, 3928, DIALOG_STYLE_LIST, "Elevator", "Vehicles\nInterior", "Select", "Cancel");
		}
	}
	return 1;
}
Hope i helped