SA-MP Forums Archive
Car spawn - 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: Car spawn (/showthread.php?tid=424675)



Car spawn - Fernado Samuel - 23.03.2013

Removed


Re: Car spawn - Jochemd - 23.03.2013

Assuming you got your own code to retrieve the model ID from name...

pawn Код:
if(modelid == 420) return SendClientMessage(playerid,-1,"Error: You cannot spawn a Hydra!");



Re: Car spawn - dusk - 23.03.2013

Well if you want the whole thing:
pawn Код:
CMD:v(playerid,params[])
{
new tmp;
if(sscanf(params,"d",tmp)) SendClientMessage(palyerid,0xFF0000FF,"Usage /v [vehicleID]");
else if(tmp<400 || tmp>611 || tmp==520) SendClientMessage(playerid,0xFF0000FF,"Invalid vehicle ID");
else
{
new Float:X,Float:Y,Float:Z;
GetPlayerPos(palyerid,X,Y,Z);
CreateVehicle(tmp,X,Y+2,Z,0,color,color,respawntime);
}
return 1;
}
You will need ZCMD and sscanf tho