25.08.2012, 16:03
Hello, I'm trying to make a vehicle transportation system (vehicle goes into an andromada and is then flown to another airport in San Andreas)
The thing that I am having difficulties with, is detecting if there are any Andromadas near, this my code (when the player presses the JUMP key).
The thing that I am having difficulties with, is detecting if there are any Andromadas near, this my code (when the player presses the JUMP key).
Код:
if(newkeys == KEY_JUMP)
{
for(new i = 0; i < MAX_VEHICLES; i++)
{
if(GetVehicleModel(i) == 592)
{
GetVehiclePos(i, Float:ax, Float:ay, Float:az);
}
}
if(IsPlayerInAnyVehicle(playerid))
{
if(!IsAPlane(newcar))
{
if(GetVehicleDistanceFromPoint(newcar, Float:ax, Float:ay, Float:az) < 20)
{
SendClientMessage(playerid, COLOR_GREEN, "IT WORKS!!");
}
SendClientMessage(playerid, COLOR_RED, "You are not near an Andromada!");
}
}
SendClientMessage(playerid, COLOR_RED, "You are not in any vehicle!");
}

