SA-MP Forums Archive
Command won't work - 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: Command won't work (/showthread.php?tid=506861)



Command won't work - RenSoprano - 14.04.2014

pawn Код:
CMD:unloadcrate(playerid, params[])
{
    new vID = GetPlayerVehicleID(playerid);
    if(GetVehicleModel(vID) == 530)
    {
        if(CrateLoadedOnFork[playerid] == 1)
        {
            new Float: vx, Float: vy, Float: vz;
            GetVehiclePos(413, vx, vy, vz);
            if(IsPlayerInRangeOfPoint(playerid, 6, vx, vy, vz))
            {
                CrateLoadedOnFork[playerid] = 0;
                CrateLoaded[playerid] = 1;
                DestroyObject(CrateID[vID]);
                SendClientMessage(playerid, -1, " You have successfully loaded crate into the trunk");
            }
        }
        else
        {
            SendClientMessage(playerid, -1, " You need to load crate first!");
        }
    }
    else
    {
        SendClientMessage(playerid, -1, " You are not in Forklift.");
    }
    return 1;
}
It isnt showing something i can spam it but its not working


Re: Command won't work - Corekt - 15.04.2014

This line:
pawn Код:
GetVehiclePos(413, vx, vy, vz);
You're supposed to get the ID of the vehicle created, not the model ID. You're not getting any client message because you're not in range of that vehicle.