Command won't work
#1

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
Reply
#2

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.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)