Vehicle Move Command Glitching
#1

So the command is supposed to move a vehicle where you move it to. Well it doesn't it spawn you next to another car that is way away.

pawn Код:
CMD:vmove(playerid, params[]) {
    if(playerVariables[playerid][pAdminLevel] >= 4) {
        if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You must be inside the vehicle that you wish to move.");

        new
            string[42];

        for(new x = 0; x < MAX_VEHICLES; x++) {
            if(vehicleVariables[x][vVehicleScriptID] == GetPlayerVehicleID(playerid)) {

                GetVehiclePos(x, vehicleVariables[x][vVehiclePosition][0], vehicleVariables[x][vVehiclePosition][1], vehicleVariables[x][vVehiclePosition][2]);
                GetVehicleZAngle(x, vehicleVariables[x][vVehicleRotation]);

                DestroyVehicle(vehicleVariables[x][vVehicleScriptID]);
                vehicleVariables[x][vVehicleScriptID] = CreateVehicle(vehicleVariables[x][vVehicleModelID], vehicleVariables[x][vVehiclePosition][0], vehicleVariables[x][vVehiclePosition][1], vehicleVariables[x][vVehiclePosition][2], vehicleVariables[x][vVehicleRotation], vehicleVariables[x][vVehicleColour][0], vehicleVariables[x][vVehicleColour][1], 60000);
                PutPlayerInVehicle(playerid, vehicleVariables[x][vVehicleScriptID], 0);

                saveVehicle(x);

                format(string, sizeof(string), "You have successfully moved vehicle %d.", x);
                SendClientMessage(playerid, COLOR_WHITE, string);
                return 1;
            }
        }
    }
    return 1;
}
Reply
#2

Bump
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)