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


Messages In This Thread
Vehicle Move Command Glitching - by Robert_Crawford - 26.10.2012, 02:42
Re: Vehicle Move Command Glitching - by Robert_Crawford - 26.10.2012, 15:59

Forum Jump:


Users browsing this thread: 1 Guest(s)