Command for creating vehicles - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Command for creating vehicles (
/showthread.php?tid=269629)
Command for creating vehicles -
tbedy - 17.07.2011
please, can you give me command which wil lcreate vehicle around me, around 10-15 vehicles...
i really dont know how to create
Re: Command for creating vehicles -
MoroDan - 17.07.2011
So, you want to create 15 vehicles near you, by typing a single command ?
Re: Command for creating vehicles -
tbedy - 17.07.2011
this is not easy?
i only ask...
but i try some command to create vehicles near me, but in range of 50
Re: Command for creating vehicles -
MoroDan - 17.07.2011
Ok, wait. I'll create you 10 vehicles in a circle.
Re: Command for creating vehicles -
MoroDan - 17.07.2011
Ok. So, i made it only for 8 cars per command. The command is /ccc or /createcirclecars.
This is the filterscript or the command:
PHP Code:
#include <a_samp>
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext,"/createcirclecars",true) || !strcmp(cmdtext,"/ccc",true))
{
new numb = 8;
new Float:mypos[3],Float:hiscoord[3],Float:distance,Float:angle,Float:myangle;
GetPlayerFacingAngle(playerid,myangle);
GetPlayerPos(playerid,mypos[0],mypos[1],mypos[2]);
static const cars[8] =
{
411, 415, 429, 451, // Speed cars
550, 559, 560, 562 // Tunned cars
};
angle = 360.0 / numb;
distance = numb * 1.2;
new j = -1;
for(new i = 0; i < numb; i++)
{
j++;
hiscoord[0] = mypos[0] + distance * floatcos(j * angle,degrees);
hiscoord[1] = mypos[1] + distance * floatsin(j * angle,degrees);
new Float:vehangle;
if(!i || i == 4) vehangle = myangle;
else if(i == 1 || i == 5) vehangle = myangle+90;
else if(i == 2 || i == 6) vehangle = myangle+180;
else vehangle = myangle+270;
new carid = CreateVehicle(cars[random(sizeof(cars))], hiscoord[0], hiscoord[1], mypos[2], vehangle, -1, -1, 600);
LinkVehicleToInterior(carid, GetPlayerInterior(playerid));
}
return 1;
}
return 0;
}
Here's the screenshot:
If you don't like, I can make you like the cars to be spawned in a line. Like race cars ...
Re: Command for creating vehicles -
tbedy - 17.07.2011
heh.... if you can make command to spawn car in line, but in ZCMD (CMD: "command")
because i need this comamnd for events and racing
Re: Command for creating vehicles -
tbedy - 17.07.2011
help
command for creating vehicles in line!?