Airport Security
#6

Quote:
Originally Posted by KtotheYle
Посмотреть сообщение
Ok, i altered what you did and got this

Код:
CMD:checkme(playerid, params[])
{
	if(!IsPlayerInRangeOfPoint(playerid, 10.0, 1960.4540,-2188.0190,13.5469))
	{
	    SendClientMessage(playerid, COLOR_RED, "You are not near the airport!");
	}
	else
	{
	    SendClientMessage(playerid, COLOR_GREEN, "Please wait while the airport security checks your vehicle and registration.");
		if(PlayerInfo[playerid][pCarLic] != 1)
		{
		    if(PlayerInfo[playerid][pSex] == 1)
		    {
				SendClientMessage(playerid, COLOR_WHITE, "Secruity Guard: Sir, you do not have a drivers license, the police have been informed and are on their way.");
			}
			else
			{
			    SendClientMessage(playerid, COLOR_WHITE, "Secruity Guard: Ma'am, you do not have a drivers license, the police have been informed and are on their way.");
			}
		}
		else if(PlayerInfo[playerid][pFlyLic] != 1)
		{
			if(PlayerInfo[playerid][pSex] == 1)
			{
			    SendClientMessage(playerid, COLOR_WHITE, "Secruity Guard: Sir, you do not have a flying license, the police have been informed and are on their way to question you.");
			}
			else
			{
			    SendClientMessage(playerid, COLOR_WHITE, "Secruity Guard: Ma'am, you do not have a flying license, the police have been informed and are on their way to question you.");
			}
		}
		else
		{
		    SendClientMessage(playerid, COLOR_WHITE, "Secruity Guard: Ok, you are free to enter the airport, have a wonderful day!(Gate will close in 6 seconds.)");
		    SetTimer("AirportGate", 200, 0);
			MoveDynamicObject(GateObject, 1956.54541, -2189.80908, 13.32070,   0.00000, 0.00000, 0.00000);
		}
	}
	return 1;
}
public AirportGate(playerid)
{
	MoveDynamicObject(GateObject, 1956.54541, -2189.80908, 13.32070,   0.00000, 90.00000, 0.00000);
}
But the gate doesn't move when the command is used, any ideas?
Try this:
Код:
CMD:checkme(playerid, params[])
{
	if(!IsPlayerInRangeOfPoint(playerid, 10.0, 1960.4540,-2188.0190,13.5469))
	{
	    SendClientMessage(playerid, COLOR_RED, "You are not near the airport!");
	}
	else
	{
	    SendClientMessage(playerid, COLOR_GREEN, "Please wait while the airport security checks your vehicle and registration.");
		if(PlayerInfo[playerid][pCarLic] != 1)
		{
		    switch(PlayerInfo[playerid][pSex])
		    {
		    	case 1:
				SendClientMessage(playerid, COLOR_WHITE, "Secruity Guard: Sir, you do not have a drivers license, the police have been informed and are on their way.");
				case 2:
			    SendClientMessage(playerid, COLOR_WHITE, "Secruity Guard: Ma'am, you do not have a drivers license, the police have been informed and are on their way.");
			}
		}
		else if(PlayerInfo[playerid][pFlyLic] != 1)
		{
			switch(PlayerInfo[playerid][pSex])
		    {
		    	case 1:
				SendClientMessage(playerid, COLOR_WHITE, "Secruity Guard: Sir, you do not have a flying license, the police have been informed and are on their way.");
				case 2:
			    SendClientMessage(playerid, COLOR_WHITE, "Secruity Guard: Ma'am, you do not have a flying license, the police have been informed and are on their way.");
			}
		}
		else
		{
		    SendClientMessage(playerid, COLOR_WHITE, "Secruity Guard: Ok, you are free to enter the airport, have a wonderful day!(Gate will close in 6 seconds.)");
		    SetTimer("AirportGate", 200, 0);
			MoveDynamicObject(GateObject, 1956.54541, -2189.80908, 13.32070, 3.0,  0.00000, 0.00000, 0.00000);
			/*
			 * MoveDynamicObject(objectid, Float:x, Float:y, Float:z, Float:speed, Float:rx = -1000.0, Float:ry = -1000.0, Float:rz = -1000.0);
			 * I noticed you forgot the speed, so it assumed the speed of 0.00000 (which I assume you meant for x rotation)
			 * check out https://sampforum.blast.hk/showthread.php?tid=102865 for more info.
			 */
		}
	}
	return 1;
}
public AirportGate()
{
	MoveDynamicObject(GateObject, 1956.54541, -2189.80908, 13.32070, 3.0,  0.00000, 90.00000, 0.00000); //The gate will not close as this is the same position. Change these coords.
}
EDIT: I assumed you were using an NGRP variant with pSex, hence it switches between 1 and 2.
Reply


Messages In This Thread
Airport Security - by KtotheYle - 05.01.2014, 17:44
Re: Airport Security - by BlackSirrah239 - 06.01.2014, 03:03
Re: Airport Security - by KtotheYle - 06.01.2014, 03:19
Re: Airport Security - by BlackSirrah239 - 06.01.2014, 04:00
Re: Airport Security - by KtotheYle - 06.01.2014, 21:39
Re: Airport Security - by BlackSirrah239 - 07.01.2014, 03:02
Re: Airport Security - by KtotheYle - 07.01.2014, 12:26

Forum Jump:


Users browsing this thread: 1 Guest(s)