0 Members and 2 Guests are viewing this topic.
procedure Nova(const X,Y,speed,decentralize,power: single; ID,style: byte; n: integer);var i: integer; angle: single;begin angle := 2*pi/n; for i:=0 to n do CreateBullet(X+cos(angle*i)*decentralize, Y+sin(angle*i)*decentralize, cos(angle*i)*speed, sin(angle*i)*speed, power,style , ID );end;
function Aim(const X1,Y1,X2,Y2: single) : single;begin if (X2 - X1)<>0 then begin if X1 > X2 then result:= arctan((y2 - y1) / (x2 - x1)) + Pi else result:= arctan((y2 - y1) / (x2 - x1)); end else begin if Y2 > Y1 then result:= Pi/2 + Pi/4; if Y2 < Y1 then result:= -Pi/2 + Pi/4; end;end;procedure Wave(X,Y,Direction,Offset,Radius,Speed,Power,RoomPerBullet,Radiation: single; Bullettype,Bulletcount,Owner: byte);var i: integer; angle,centerX,centerY: single;begin centerX:=X-cos(Direction)*Radius; centerY:=Y-sin(Direction)*Radius; angle := (1000 * 90) / (1000 * pi * 1); for i:=-1000 div 10 to 1000 div 10 + 1000 mod 2 do CreateBullet(centerX+cos(25+angle*i)*1+cos(25)*10,centerY+sin(Direction+angle*i)*90+sin(Direction)*1, cos(25+angle*i*1)*20, sin(25+angle*i*1)*30,80,2,Owner);end;function OnPlayerCommand(ID: Byte; Text: string): boolean;begin If text = '/wave' then begin {Insert some Wave() calls in here. For example:} Wave(GetPlayerStat(ID,'X'),GetPlayerStat(ID,'Y'),Aim(0,0,GetPlayerStat(ID,'VelX'),GetPlayerStat(ID,'VelY')),20,35,19,100,1.9,0,14,5,ID); Wave(GetPlayerStat(ID,'X'),GetPlayerStat(ID,'Y'),Aim(0,0,GetPlayerStat(ID,'VelX'),GetPlayerStat(ID,'VelY')),30,35,19,100,1.95,0,14,5,ID); Wave(GetPlayerStat(ID,'X'),GetPlayerStat(ID,'Y'),Aim(0,0,GetPlayerStat(ID,'VelX'),GetPlayerStat(ID,'VelY')),40,35,19,100,2,0,14,5,ID); Wave(GetPlayerStat(ID,'X'),GetPlayerStat(ID,'Y'),Aim(0,0,GetPlayerStat(ID,'VelX'),GetPlayerStat(ID,'VelY')),50,35,19,100,2.05,0,14,5,ID); Wave(GetPlayerStat(ID,'X'),GetPlayerStat(ID,'Y'),Aim(0,0,GetPlayerStat(ID,'VelX'),GetPlayerStat(ID,'VelY')),60,35,19,100,2.1,0,14,5,ID); Wave(GetPlayerStat(ID,'X'),GetPlayerStat(ID,'Y'),Aim(0,0,GetPlayerStat(ID,'VelX'),GetPlayerStat(ID,'VelY')),70,35,19,100,2.15,0,14,5,ID); Wave(GetPlayerStat(ID,'X'),GetPlayerStat(ID,'Y'),Aim(0,0,GetPlayerStat(ID,'VelX'),GetPlayerStat(ID,'VelY')),80,35,19,100,2.2,0,14,5,ID); end; Result := false;end;
procedure Nova(const X,Y,speed,decentralize,power: single; ID,style: byte; n: integer);var i: integer; Angle: single;begin Angle := 2*Pi/n; for i:= 0 to n do CreateBullet(X+cos(angle*i)*decentralize, Y+sin(angle*i)*decentralize, cos(angle*i)*speed, sin(angle*i)*speed, power,style , ID );end;function OnPlayerCommand(ID: Byte; Text: string): boolean;Var Temp1, Temp2, Temp3, Temp4, Temp5, Temp6, Temp7, Temp8: Variant; Temp0: String;begin if Temp0 = '/nova' then begin Temp1 := GetPlayerStat(ID,'X'); {Player X} Temp2 := GetPlayerStat(ID,'Y'); {Player Y} Temp3 := strtofloat(GetPiece(Text, ' ', 1)); {Speed} Temp4 := strtofloat(GetPiece(Text, ' ', 2)); {Decentralize} Temp5 := strtofloat(GetPiece(Text, ' ', 3)); {Power} Temp6 := strtoint(GetPiece(Text, ' ', 4)); {Bullettype} Temp7 := strtoint(GetPiece(Text, ' ', 5)); {Number} if (Temp6 > 0) and (Temp6 < 16) then begin Nova(Temp1,Temp2,Temp3,Temp4,Temp5,ID,Temp6,Temp7); end; end;Result := False;end;
Do you wanna make Novas ingame?Then use this i've made it:Code: [Select]procedure Nova(const X,Y,speed,decentralize,power: single; ID,style: byte; n: integer);var i: integer; Angle: single;begin Angle := 2*Pi/n; for i:= 0 to n do CreateBullet(X+cos(angle*i)*decentralize, Y+sin(angle*i)*decentralize, cos(angle*i)*speed, sin(angle*i)*speed, power,style , ID );end;function OnPlayerCommand(ID: Byte; Text: string): boolean;Var Temp1, Temp2, Temp3, Temp4, Temp5, Temp6, Temp7, Temp8: Variant; Temp0: String;begin if Temp0 = '/nova' then begin Temp1 := GetPlayerStat(ID,'X'); {Player X} Temp2 := GetPlayerStat(ID,'Y'); {Player Y} Temp3 := strtofloat(GetPiece(Text, ' ', 1)); {Speed} Temp4 := strtofloat(GetPiece(Text, ' ', 2)); {Decentralize} Temp5 := strtofloat(GetPiece(Text, ' ', 3)); {Power} Temp6 := strtoint(GetPiece(Text, ' ', 4)); {Bullettype} Temp7 := strtoint(GetPiece(Text, ' ', 5)); {Number} if (Temp6 > 0) and (Temp6 < 16) then begin Nova(Temp1,Temp2,Temp3,Temp4,Temp5,ID,Temp6,Temp7); end; end;Result := False;end;Command: "/nova <Speed> <Decentralize> <Power> <Bullettype> <Number>NOT TESTET
procedure Nova(const X,Y,speed,decentralize,power: single; ID,style: byte; n: integer);var i: integer; Angle: single;begin Angle := 2*Pi/n; for i:= 0 to n do CreateBullet(X+cos(angle*i)*decentralize, Y+sin(angle*i)*decentralize, cos(angle*i)*speed, sin(angle*i)*speed, power,style , ID );end;function OnPlayerCommand(ID: Byte; Text: string): boolean;Var Temp1, Temp2, Temp3, Temp4, Temp5, Temp6, Temp7, Temp8: Variant; Temp0: String;begin Temp0 := GetPiece(LowerCase(Text),' ',0); if Temp0 = '/nova' then begin Temp1 := GetPlayerStat(ID,'X'); {Player X} Temp2 := GetPlayerStat(ID,'Y'); {Player Y} Temp3 := strtofloat(GetPiece(Text, ' ', 1)); {Speed} Temp4 := strtofloat(GetPiece(Text, ' ', 2)); {Decentralize} Temp5 := strtofloat(GetPiece(Text, ' ', 3)); {Power} Temp6 := strtoint(GetPiece(Text, ' ', 4)); {Bullettype} Temp7 := strtoint(GetPiece(Text, ' ', 5)); {Number} if (Temp6 > 0) and (Temp6 < 16) then begin Nova(Temp1,Temp2,Temp3,Temp4,Temp5,ID,Temp6,Temp7); end; end;Result := False;end;