17.07.2011, 09:54
please, can you give me command which wil lcreate vehicle around me, around 10-15 vehicles...
i really dont know how to create
i really dont know how to create
#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;
}