Float Function
#3

with the floatsin/floatcos you can calculate the x,y position by giving an angle and the radius.
Код:
dcmd_Cars(playerid,params[])
{
  new Float:X,Float:Y,Float:Z;//,Float:A;
  GetPlayerPos(playerid,X,Y,Z);
	for(new i = 0; i<360; i+=10)
	{
    new Float:CX,Float:CY,Float:CZ,Float:CA;
		CX=X+(20*floatsin(i,degrees));
		CY=Y+(20*floatcos(i,degrees));
		CZ=Z;
		CA=(-i+180)%360;
		Veh[Vehicles]=AddStaticVehicle(412,CX,CY,CZ,CA,-1,-1,-1);Vehicles++;
	}
	SendClientMessage(playerid,0xafafff77,"Vehicle(s) spawned.");
	return 1;
}
that snipped lets you spawn some cars in a circle - dont forget to add those 2 lines at top of your script, they are holding the cars itself, aswell the vehicle-"counter":
Код:
new Vehicles;
new Veh[2000];
Reply


Messages In This Thread
Float Function - by deather - 14.03.2010, 10:41
Re: Float Function - by Correlli - 14.03.2010, 10:53
Re: Float Function - by Babul - 14.03.2010, 11:17

Forum Jump:


Users browsing this thread: 1 Guest(s)