0 Members and 1 Guest are viewing this topic.

function arctan2(X, Y: single): single;begin if X < 0 then Result := arctan(Y/X) + Pi else if X > 0 then Result := arctan(Y/X) else if Y > 0 then Result := 1.5707 else Result := -1.5707;end;a:= arctan(X2-X1,Y2-Y1);

vX:= cos(a)*velocity;vY:= sin(a)*velocity;CreateBullet(TurretX,TurretY,vX,vY,Power,Style,ID);

CreateBullet function doesn't use any values from weapon mod, you need to manually specify bullet power (~10000 for sure kill). Also resulting damage will be effected by the speed of the bullet. So don't set speed to 0 if bullet is spawned just inside the player.

Code: [Select]function arctan2(X, Y: single): single;begin if X < 0 then Result := arctan(Y/X) + Pi else if X > 0 then Result := arctan(Y/X) else if Y > 0 then Result := 1.5707 else Result := -1.5707;end;

function arctan2(X, Y: single): single;begin if X < 0 then Result := arctan(Y/X) + Pi else if X > 0 then Result := arctan(Y/X) else if Y > 0 then Result := 1.5707 else Result := -1.5707;end;

Because Dodamage results in selfkill of target, like i said earlier, that is not what i wanted

thanks Gizd , im guessing the syntax is DoDamageBy(Target,Owner) ?also where did you get that function? it isnt on:http://enesce.com/help/ or http://devs.soldat.pl/wiki/index.php?title=Server_Scripting

also where did you get that function? it isnt on:http://enesce.com/help/ or http://devs.soldat.pl/wiki/index.php?title=Server_Scripting

NOTE: If you wish to be able to specify a player ID doing damage, use DoDamageBy: procedure DoDamageBy(ID,Shooter: Byte; Damage: Integer);

hmm ill have to stick with CreateBullet, DoDamageBy with 99 set as damage causes way worse lag than createbullet and actually continuosly causes the script to crash and the server to completely hang, hmm

nevermind, got CreateBullet to work fine, dont need DoDamageBy

if Weapon = 'Barrett M82A1' then begin for i := 1 to 32 do begin x := GetPlayerStat(Victim,'x'); y := GetPlayerStat(Victim,'y'); x2 := GetPlayerStat(i,'x'); y2 := GetPlayerStat(i,'y'); if RayCast(x,y,x2,y2,Dist,400) then begin if i <> Killer then begin if GetPlayerStat(i,'Alive') = true then begin //WriteLn(IDtoName(i)+' is in range of Raycast'); //CreateBullet(GetPlayerStat(i,'x'), GetPlayerStat(i,'y') - 0, 0,-1000,100, 3, Killer); DoDamageBy(i, Killer, 99); BioKills[Killer]:=BioKills[Killer]+1; end; end; end; end; WriteConsole(Killer,'Bio-Kills: '+Inttostr(BioKills[Killer]),$EE81FAA1); BioKills[Killer]:=BioKills[Killer]*0; end;

If player is close to wall it might change.

procedure AppOnIdle(Ticks: integer);vari: integer;Weapon: array[1..255] of array[1..32];beginfor i:= 1 to 32 do Weapon[GetPlayerStat(i, 'Primary')][i];end;end;//and then instead ofif Weapon = 'Barrett M82A1' then begin for i := 1 to 32 do //placefor i: 1 to 32 do if Weapon[8][i] then begin // or something like that. again, i would need to see the whole script

Last year, I dreamt I was pissing at a restroom, but I missed the urinal and my penis exploded.