09.05.2013, 13:14
Try this:
pawn Код:
command(gate, playerid, params[])
{
if(IsPlayerInRangeOfPoint(playerid, 10.0, 237.8999, 66.5000, 2.5000))
{
if(ScrapGateOpen == 0)
{
if(Player[playerid][Money] >= 15)
{
Player[playerid][Money] -= 15;
MoveDynamicObject(ScrapGate, 237.8999, 66.5000, 7.0000, 3.0, 0.0, 0.0, 180.0);
ScrapGateOpen = 1;
SendClientMessage(playerid, WHITE, "You have entered the Scrap Yard and it has cost you $15.");
SetTimer("ScrapGateMove", 5000, 0);
}
else return SendClientMessage(playerid, GREY, "You must have $15 to enter the Scrap Yard.");
}
else return SendClientMessage(playerid, GREY, "The Scrap Yard gate is already open.");
}
else return SendClientMessage(playerid, GREY, "You are not in range of a gate.");
if(Factions[Player[playerid][Faction]][fType] == 1)
{
if(IsPlayerInRangeOfPoint(playerid, 15.0, 618.0996, -596.7998, 18.1000))
{
if(DPDGateOpen == 0)
{
MoveDynamicObject(DPDGate1, 618.0999, -601.4000, 21.0, 3.0, 0.0, 0.0, 270.0);
MoveDynamicObject(DPDGate2, 618.0996, -596.7999, 21.1000, 3.0, 0.0, 0.0, 270.0);
SetTimer("DPDGateMove", 5000, 0);
DPDGateOpen = 1;
}
else return SendClientMessage(playerid, GREY, "The gate of the Dillimore Police Garage is already open.");
}
}
else return SendClientMessage(playerid, GREY, "You are not in the current faction to use this gate.");
return 1;
}