SA-MP Forums Archive
Crate System - 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)
+--- Thread: Crate System (/showthread.php?tid=473643)



Crate System - FaZeRs - 03.11.2013

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;




Re: Crate System - Gogorakis - 03.11.2013

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.


Respuesta: Crate System - DanDRT - 03.11.2013

Are not numbers, are coordinated. /\


Re: Respuesta: Crate System - Gogorakis - 03.11.2013

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