/getveh - 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: /getveh (
/showthread.php?tid=544927)
/getveh -
JaydenJason - 04.11.2014
Using GF, if possible could someone make a /getveh [vehid] cmd, which sets an existing vehicle position and angle to the current position and angle of the player that has entered the command, if possible for admin level 3 and higher. and if the vehicle id does not exist send a message saying "Not an existing vehicle id"
Cheers, will rep.
Re: /getveh -
Abagail - 04.11.2014
Replace IsPlayerAdmin to use your admin variable/system.
pawn Код:
CMD:getcar(playerid, params[])
{
if(IsPlayerAdmin(playerid))
{
if(sscanf(params, "d", vehicleid)) return SendClientMessage(playerid, -1, "USAGE: /getcar [car]");
if(IsValidVehicle(vehicleid))
{
new Float: pos[3];
GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
SetVehiclePos(playerid, pos[0], pos[1], pos[2]);
SetPlayerPos(playerid, pos[0], pos[1]+3.0, pos[2]);
return 1;
}
else return SendClientMessage(playerid, -1, "That vehicle isn't valid.");
}
else return SendClientMessage(playerid, -1, "Your not an admin!");
}
Or of-course you could've simply
searched. Anyway, basically you need to get the player's pos, and then set the vehicle's coordinates accordingly.
Re: /getveh -
JaydenJason - 05.11.2014
Cheers Abagail, will try it out later today.