CMD - 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: CMD (
/showthread.php?tid=389535)
CMD -
Beckett - 02.11.2012
------
Re: CMD -
DBan - 02.11.2012
Honestly, this is ridiculously easy.
Using ZCMD:
pawn Код:
CMD:veh(playerid, params[])
{
new Float:x, Float:y, Float:z, Float:a, vehid = strval(params); // Creates the variables, creates vehid which is formatted to be the id typed after /veh
GetPlayerPos(playerid, x, y, z); // Gets the player's position, formats it into the variables.
GetPlayerFacingAngle(playerid, a); // His facing angle, formats it into its variable.
CreateVehicle(vehid, x+3, y+3, z+3, a, -1, -1, 120); // Finally, spawning the vehicle. I added +3 so that it doesn't spawn directly under the player or anything.
return 1;
}
Re: CMD -
[LB]GoLd_DeViL - 17.01.2013
Hey DBan
Re: CMD -
ryansheilds - 17.01.2013
pawn Код:
CMD:getveh(playerid, params[]) {
new iVehID;
if(sscanf(params, "i", iVehID))
return SendClientMessage(playerid, -1, "USAGE: {FFFFFF}/getveh [vehid]");
if(iVehID == 0)
return SendClientMessage(playerid, -1, "Invalid vehicle ID ( 1+ )");
new Float:p_fPos[3];
GetPlayerPos(playerid, p_fPos[0], p_fPos[1], p_fPos[2]);
SetVehiclePos(iVehID, p_fPos[0], p_fPos[1], p_fPos[2]);
SetVehicleVirtualWorld(iVehID, GetPlayerVirtualWorld(playerid));
LinkVehicleToInterior(iVehID, GetPlayerInterior(playerid));
return 1;
}
Teleports existing vehicles.