20.10.2011, 22:43
(
Последний раз редактировалось NaS; 21.10.2011 в 14:39.
)
To create a line with GangZones from A to B (ZoneSize is the size of every little zone AND the distance between each zone):
And I think the easiest way to crash a player is:
522 is the object of a vehicle (NRG-500), this will lead to a crash.
Код:
CreateGangZoneLine(Float:ZoneSize,Float:X1,Float:Y1,Float:X2,Float:Y2) { // ZoneSize is the size of each "dot" AND the distance between each dot! new Float:TotalDistance = GetDistanceBetweenPoints(X1,Y1,0.0,X2,Y2,0.0); new Dots = floatround(TotalDistance / ZoneSize); // Amount of "dots" to create for(new i=1; i <= Dots; i++) { new Float:X,Float:Y; X = X1 + (((X2 - X1) / Dots) * i ); // Dots is like percentage. If you have 10 dots, the first one is at 1/10, second at 2/10 etc! Y = Y1 + (((Y2 - Y1) / Dots) * i ); new Float:Offset = ZoneSize / 2.0; new zone = GangZoneCreate(X-Offset,Y-Offset,X+Offset,Y+Offset); // Example showing the zone for all: GangZoneShowForAll(zone,0xFF000055); // I suggest to save em to an array, to destroy it later :P } }
Код:
CrashPlayer(playerid) { new Float:X,Float:Y,Float:Z; GetPlayerPos(playerid,X,Y,Z); CreatePlayerObject(playerid,522,X,Y,Z,0.0,0.0,0.0,1000); }