Just wondering [SetVehicleNumberPlate]
#1

Hello guys!

I'm wondering how can I do this, I already made a command that change the Vehicle's plate to whatever you want but I know you have to respawn the vehicle but it respawns the vehicle where it was created, but I want the vehicle to respawn at it's current position, it this possible? if so how.

Thanks in advance.
Reply
#2

pawn Код:
new Float:x, Float:y, Float:z; // Create the variables to store some floats...
GetVehiclePos(VehicleThatUChangedThePlate,x,y,z); // store the floats into that variables
SetVehicleToRespaw(VehicleThatUChangedThePlate); // Respawn the vehicle
SetVehiclePos(VehicleThatUChangedThePlate,x,y,z); // Now set vehicle the previous pos :D
// You can also use GetVehicleZAngle and SetVehicleZAngle...

I think this will work '-'
Reply
#3

D: it didn't work

PHP код:
    new veh;
    
veh GetPlayerVehicleID(targetid);
    new 
Float:vehxFloat:vehyFloat:vehz;
    
GetVehiclePos(vehvehxvehyvehz);
    
SetVehicleToRespawn(veh);
    
SetVehiclePos(vehvehxvehyvehz); 
Reply
#4

Quote:
Originally Posted by [CG]Milito
Посмотреть сообщение
D: it didn't work

PHP код:
    new veh;
    
veh GetPlayerVehicleID(targetid);
    new 
Float:vehxFloat:vehyFloat:vehz;
    
GetVehiclePos(vehvehxvehyvehz);
    
SetVehicleToRespawn(veh);
    
SetVehiclePos(vehvehxvehyvehz); 
Well, I doubt that in one fraction of a second, you can respawn and reposition the vehicle. Try using a timer. Respawn the vehicle, start a one second timer and then set the vehicle position? That should work...

pawn Код:
new veh;
    veh = GetPlayerVehicleID(targetid);
    new Float:vehx, Float:vehy, Float:vehz;
    GetVehiclePos(veh, vehx, vehy, vehz);
    SetVehicleToRespawn(veh);
    SetTimerEx("RepositionVehicle", 1000, false, "ifff", veh, vehx, vehy, vehz);

//

forward RepositionVehicle(vehicleid, vehX, vehY, vehZ);
public RepositionVehicle(vehicleid, vehX, vehY, vehZ)
{
    SetVehiclePos(vehicleid, vehX, vehY, vehZ);
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)