0 Members and 1 Guest are viewing this topic.
amount1 := 0;amount1 := 0; for k:= 1 to 254 do if GetSpawnStat(k,'Style') = 1 then begin amount1 := amount1 + 1; alphaspawnstyle[amount1] := k; end; for k:= 1 to 254 do if GetSpawnStat(k,'Style') = 2 then begin amount2 := amount2 + 1; bravospawnstyle[amount2] := k; end;
if numplayers > 0 then begin for i := 1 to 32 do begin kill[i] := true; end letskill := true;end
if letskill then begin for i := 1 to 32 do if kill[i] and (GetPlayerStat(i,'Active') = true) then begin kill[i] := false; if GetPlayerStat(i,'Team') = 1 then begin for j := 1 to amount1 do begin if Distance(GetPlayerStat(i,'x'),GetPlayerStat(i,'y'),GetSpawnStat(alphaspawnstyle[j],'x'),GetSpawnStat(alphaspawnstyle[j],'y')) > 500 then begin DoDamage(i,4000); WriteConsole(i, 'Possible spawnbug, player killed.', $00EE76); WriteLn('Possible spawnbug detected, player '+IDToName(i)+' killed.'); break; end end end else if GetPlayerStat(i,'Team') = 2 then begin for j := 1 to amount2 do begin if Distance(GetPlayerStat(i,'x'),GetPlayerStat(i,'y'),GetSpawnStat(bravospawnstyle[j],'x'),GetSpawnStat(bravospawnstyle[j],'y')) > 500 then begin DoDamage(i,4000); WriteConsole(i, 'Possible spawnbug, player killed.', $00EE76); WriteLn('Possible spawnbug detected, player '+IDToName(i)+' killed.'); break; end end end end letskill := false;end
if Distance(GetPlayerStat(i,'x'),GetPlayerStat(i,'y'),GetSpawnStat(alphaspawnstyle[j],'x'),GetSpawnStat(alphaspawnstyle[j],'y')) > 500 then begin
And aren't you missing semicolons here? Shouldn't blocks end with it?
You check player's distance from every spawn, i'm quite sure that on most maps there is spawn farer than 500 pixels. Remake it to check only the lowest value.
EDIT: Also, mind using GetPlayerXY() instead of GetPlayerStats, as it's faster and more stable
QuoteEDIT: Also, mind using GetPlayerXY() instead of GetPlayerStats, as it's faster and more stableIs it? Didn't know that, thanks.