Crate System
#1

I go all time with forklift behing airplane opening the back of airplane but it all time says Im not near airplane
Who can help?

PHP Code:
CMD:loadplane(playeridparams[]) {
    new 
vehicleid GetPlayerVehicleID(playerid);
    if(
vehicleid == CrateIslandVehicles[2] || vehicleid == CrateIslandVehicles[3] ||vehicleid == CrateIslandVehicles[4] || GetVehicleModel(vehicleid) == 530)
    {
        if(
CrateVehicleLoad[vehicleid][vForkLoaded])
        {
            new 
PlaneFoundFreeSlot;
            
PlaneFound INVALID_VEHICLE_ID;
            
FreeSlot = -1;
            new 
Float:vxFloat:vyFloat:vz;
            for(new 
0sizeof(CrateIslandVehicles); i++)
            {
                
GetPosBehindVehicle(CrateIslandVehicles[i], vxvyvz, -8);
                if(
IsPlayerInRangeOfPoint(playerid6vxvyvz))
                {
                    if(
GetVehicleModel(CrateIslandVehicles[i]) == 592)
                    {
                        
PlaneFound CrateIslandVehicles[i];
                        break;
                    }
                }
            }
            if(
PlaneFound != INVALID_VEHICLE_ID)
            {
                for(new 
06i++)
                {
                    if(
CrateVehicleLoad[PlaneFound][vCrateID][i] == -1)
                    {
                        
FreeSlot i;
                        break;
                    }
                }
            }
            if(
PlaneFound == INVALID_VEHICLE_ID) return SendClientMessageEx(playeridCOLOR_GRAD2"You're not near a plane!");
            
DestroyDynamicObject(CrateVehicleLoad[vehicleid][vForkObject]);
            
CrateVehicleLoad[vehicleid][vForkLoaded] = 0;
            
CrateVehicleLoad[vehicleid][vForkObject] = INVALID_OBJECT_ID;
            
CrateVehicleLoad[PlaneFound][vCrateID][FreeSlot] = CrateVehicleLoad[vehicleid][vCrateID][0];
            
CrateInfo[CrateVehicleLoad[PlaneFound][vCrateID][FreeSlot]][InVehicle] = PlaneFound;
            
CrateVehicleLoad[vehicleid][vCrateID][0] = -1;
            
SendClientMessageEx(playeridCOLOR_GRAD2"You loaded a crate onto the plane!");
        }
        else
        {
            return 
SendClientMessageEx(playeridCOLOR_GRAD2"You don't have a crate loaded!");
        }
    }
    else
    {
        return 
SendClientMessageEx(playeridCOLOR_GRAD2"You're not in a forklift!");
    }
    return 
1;

Reply
#2

I am not good at scripting but I suggest you make the
Quote:

if(IsPlayerInRangeOfPoint(playerid, 6, vx, vy, vz))

to
Quote:

if(IsPlayerInRangeOfPoint(playerid, 6, [PUT NUMBERS], [PUT NUMBERS], [PUT NUMBERS]))

if the plane is mapped and stable.
Reply
#3

Are not numbers, are coordinated. /\
Reply
#4

Quote:
Originally Posted by DanDRT
View Post
Are not numbers, are coordinated. /\
As I said...I am a beginner
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)