Just wondering [SetVehicleNumberPlate] - 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: Just wondering [SetVehicleNumberPlate] (
/showthread.php?tid=410269)
Just wondering [SetVehicleNumberPlate] -
[CG]Milito - 24.01.2013
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.
Re: Just wondering [SetVehicleNumberPlate] -
arakuta - 24.01.2013
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 '-'
Respuesta: Just wondering [SetVehicleNumberPlate] -
[CG]Milito - 25.01.2013
D: it didn't work
PHP код:
new veh;
veh = GetPlayerVehicleID(targetid);
new Float:vehx, Float:vehy, Float:vehz;
GetVehiclePos(veh, vehx, vehy, vehz);
SetVehicleToRespawn(veh);
SetVehiclePos(veh, vehx, vehy, vehz);
Re: Respuesta: Just wondering [SetVehicleNumberPlate] -
antonio112 - 25.01.2013
Quote:
Originally Posted by [CG]Milito
D: it didn't work
PHP код:
new veh;
veh = GetPlayerVehicleID(targetid);
new Float:vehx, Float:vehy, Float:vehz;
GetVehiclePos(veh, vehx, vehy, vehz);
SetVehicleToRespawn(veh);
SetVehiclePos(veh, vehx, vehy, vehz);
|
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;
}