blocks vehicle ids - 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: blocks vehicle ids (
/showthread.php?tid=299816)
blocks vehicle ids -
manchestera - 27.11.2011
HI there ive got a vehicle teleport cmd but i would like to beable to block some vehicle being spawned how could i do this many thanks.
Код:
CMD:v(playerid, params[])
{
if(DeathMatch[playerid] != 0) return SendClientMessage(playerid, COLOR_RED, "You can not TP from DM. Use /exitdm to leave.");
if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_RED, "* You must leave this vehicle to spawn a new one!");
new
sCar,
VehicleID,
Float:X,
Float:Y,
Float:Z,
Float:Ang,
Int;
if(unformat(params, "s[20]", params)) return SendClientMessage(playerid, COLOR_RED, ""#CRED"USAGE: "#CORANGE"/Car < CarID | Model >");
sCar = GetVehicleModelIDFromName(params);
if(sCar < 400 || sCar > 611) return SendClientMessage(playerid, COLOR_RED, "* Invalid vehicle model!");
GetPlayerPos(playerid,X, Y, Z);
GetPlayerFacingAngle(playerid, Ang);
Int = GetPlayerInterior(playerid);
VehicleID = CreateVehicle(sCar, X, Y, Z, Ang, -1, -1, -1);
SetVehicleVirtualWorld(VehicleID, GetPlayerVirtualWorld(playerid));
PutPlayerInVehicle(playerid, VehicleID, 0);
LinkVehicleToInterior(VehicleID, Int);
SendFMessage(playerid, -1, ""#CORANGE"You have spawned a: "#CBLUE"%s "#CWHITE"- "#CBLUE"%d", VehicleNames[sCar - 400], sCar);
return 1;
}
Re: blocks vehicle ids -
SmiT - 27.11.2011
Example for blocking model id 450:
pawn Код:
CMD:v(playerid, params[])
{
if(DeathMatch[playerid] != 0) return SendClientMessage(playerid, COLOR_RED, "You can not TP from DM. Use /exitdm to leave.");
if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_RED, "* You must leave this vehicle to spawn a new one!");
new
sCar,
VehicleID,
Float:X,
Float:Y,
Float:Z,
Float:Ang,
Int;
if(unformat(params, "s[20]", params)) return SendClientMessage(playerid, COLOR_RED, ""#CRED"USAGE: "#CORANGE"/Car < CarID | Model >");
sCar = GetVehicleModelIDFromName(params);
if(sCar < 400 || sCar > 611) return SendClientMessage(playerid, COLOR_RED, "* Invalid vehicle model!");
if ( sCar == 450 ) return SendClientMessage( playerid, -1, "Model 450 is blocked" ); /* <---- */
GetPlayerPos(playerid,X, Y, Z);
GetPlayerFacingAngle(playerid, Ang);
Int = GetPlayerInterior(playerid);
VehicleID = CreateVehicle(sCar, X, Y, Z, Ang, -1, -1, -1);
SetVehicleVirtualWorld(VehicleID, GetPlayerVirtualWorld(playerid));
PutPlayerInVehicle(playerid, VehicleID, 0);
LinkVehicleToInterior(VehicleID, Int);
SendFMessage(playerid, -1, ""#CORANGE"You have spawned a: "#CBLUE"%s "#CWHITE"- "#CBLUE"%d", VehicleNames[sCar - 400], sCar);
return 1;
}
Re: blocks vehicle ids -
manchestera - 27.11.2011
Thanks man. Ill try it out