var
Temp:String;
procedure SetPlayerStat(ID: byte; Stat: string;Value: variant);
begin
end;
function OnCommand(ID: Byte; Text: string): boolean;
begin
Result := false;
if LowerCase(Copy(Text, 1, 5)) = '/big ' then begin
Temp := Copy(Text, 6, length(Text)); // Then I copy anything after the first space into a var
if Temp <> '' then begin
DrawText(0,Temp+'!',330,RGB(255,255,255),0.20,40,240);
end else WriteConsole(0, 'Admin has just failed epicly!', $FF0000); // error messagez
end;
if Text = '/invin' then
begin
SetPlayerStat(ID, 'Health',999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999);
WriteConsole(ID,'temporary invinicibility enabled',$FF0000);
end;
end;
procedure OnPlayerSpeak(ID: Byte; Text: string);
begin
if Text = '!adminlist' then
begin
WriteConsole(0,'Head admin:',$EEFF8000);
WriteConsole(0,'[NMJAS][FSG][Anti]Frost',$EEFF8000);
WriteConsole(0,'',$EEFF8000);
WriteConsole(0,'Scripters/Second Head admin',$EEFFFF00);
WriteConsole(0,'DARK NEO',$EEFFFF00);
WriteConsole(0,'',$EEFFFF00);
WriteConsole(0,'Event Admins:',$EE00FF00);
WriteConsole(0,'<MT> Banan',$EE00FF00);
WriteConsole(0,'-GP- Abumi',$EE00FF00);
WriteConsole(0,'',$EE00FF00);
WriteConsole(0,'',$EE00FF00);
WriteConsole(0,'',$EE00FFFF);
end;
if Text = '!rules' then
begin
WriteConsole(0,'->No offensive behavior towards admin!',$EE00FF00);
WriteConsole(0,'',$EE00FF00);
WriteConsole(0,'->Do as the admin tell you!',$EE00FF00);
WriteConsole(0,'',$EE00FF00);
WriteConsole(0,'->NO mass spawning or teleing to flag',$EE00FF00);
WriteConsole(0,'if you need to mass spawn then get admins go ahead first!',$EE00FF00);
WriteConsole(0,'if you are unsure of something then ask',$EE00FF00);
WriteConsole(0,'',$EE00FF00);
WriteConsole(0,'->Cheating is not allowed',$EE00FF00);
WriteConsole(0,'scripts should be more than enough to compensate',$EE00FF00);
WriteConsole(0,'',$EE00FF00);
WriteConsole(0,'',$EE00FF00);
WriteConsole(0,'->No joining Bravo team',$EE00FF00);
WriteConsole(0,'if you are being an annoyance with this',$EE00FF00);
WriteConsole(0,'you WILL be kicked so take it as a warning',$EE00FF00);
WriteConsole(0,'you only get 1 chance with this!',$EE00FF00);
WriteConsole(0,'',$EE00FF00);
WriteConsole(0,'',$EE00FF00);
WriteConsole(0,'if you have any queries concerning rules then contact any admin',$EE00FF00);
WriteConsole(0,'We are happy to help!',$EE00FF00);
end;
end;
SetPlayerStat(ID, 'Health',999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999);
Won't do anything else than setting your health to 200 which doesn't make you invincible.procedure SetPlayerStat(ID: byte; Stat: string;Value: variant);
begin
end;
add one more "end;" in the end of procedure OnCommand, i see there 4 begins but 3 ends
end else WriteConsole(0, 'Admin has just failed epicly!', $FF0000); // error messagez
oh yea... sorry, i thought there was end else BEGIN xD just havent seen it, my mistake
procedure inisave(FileName: string; var iniFile: TINIFile);
begin
end;
function iniload(FileName: string): TINIFile;
begin
end;
procedure iniwrite(FileName, section, key, value: string);
begin
end;
Just pasting this into your script doesn't make it work...
[*] Shop -> [Error] (1:1): Variable Expected
[*] Compiling Shop -> Done in 0.03 secs
Shutting down server...
procedure iniSave(FileName: string; var iniFile: TINIFile);
procedure iniSave(FileName: string; var iniFile: TINIFile);
inisave('Players/'+GetPlayerStat(ID,'Name')+'.ini',iniLoad('Players/'+GetPlayerStat(ID,'Name')+'.ini'));
inisave('Players/'+GetPlayerStat(ID,'Name')+'.ini',iniLoad('Players/'+GetPlayerStat(ID,'Name')+'.ini'));
function GetTickCount(): cardinal;
It is the same "tick unit" used by AppOnIdle. Return type is cardinal, or integer; not certain, but if I recall correctly I saw it first posted with type cardinal, which does not match AppOnIdle :/ not sure why but whatever, they are still interchangeable usually.
@tyxstand:Code: [Select]function GetTickCount(): cardinal;
It is the same "tick unit" used by AppOnIdle. Return type is cardinal, or integer; not certain, but if I recall correctly I saw it first posted with type cardinal, which does not match AppOnIdle :/ not sure why but whatever, they are still interchangeable usually.
It is real. Test it out yourself if you do not believe me.@tyxstand:Code: [Select]function GetTickCount(): cardinal;
It is the same "tick unit" used by AppOnIdle. Return type is cardinal, or integer; not certain, but if I recall correctly I saw it first posted with type cardinal, which does not match AppOnIdle :/ not sure why but whatever, they are still interchangeable usually.
uhhhm, GetTickCount is a real function? i've never heard of that anywhere. or are you suggesting that it should be implemented?
Procedure OnPlayerCommand()
if Text = '/char' then begin
WriteConsole(ID,'Your stats',$EE81FAA1);
WriteConsole(ID,'Total Kills: '+inttostr(trKills[ID])+'!',$EE81FAA1);
WriteConsole(ID,'Rank: '+ReadINI('Players/'+GetPlayerStat(ID,'Name')+'.ini','stats','rank','*ERROR while loading rank*')+'!',$EE81FAA1);
WriteConsole(ID,'Class: '+ReadINI('Players/'+GetPlayerStat(ID,'Name')+'.ini','stats','class','*ERROR while loading kills*')+'!',$EE81FAA1);
WriteConsole(ID,'Total number of Predators used: '+ReadINI('Players/'+GetPlayerStat(i,'Name')+'.ini','stats','tupred','*ERROR while loading pred num*')+'!',$EE81FAA1);
WriteConsole(ID,'Total number of Achievements: '+ReadINI('Players/'+GetPlayerStat(i,'Name')+'.ini','stats','kills','*ERROR while loading achievements*')+'!',$EE81FAA1);
end;
end;
[stats]
IP=
reg=1
kills=0
rank=1
class=1
tupred=0
tna=1
[achievements]
TP=1
GetPlayerStat(i,'Name')
Function OnPlayerCommand(ID:Byte; Text:String):Boolean;
begin
Result := false // set to true to disallow commands
end;
lol oops, u get the point tho, thanks dark
From: July 18, 2010, 11:53:10 pm
omg how the feck do i debug this?
for some reason lines are disappearing from the ini file, and some are being changed randomly
but there is nothing used in the code to remove keys from the ini file, only think that is is the code for the iniremovekey or whatever they were, but those functions arent being used, as for the randomly changing keys...., maybe theres somehing else thats causing this, but i got a headache and cant think at the moment, this is aggrivating
From: July 18, 2010, 11:57:05 pm
seems to be caused on lag spike
procedure apponidle
if Timer = 0 then begin
//Writeconsole(0,'saving all accounts',$0000FFFF);
//Command('/save');
for i:= 1 to 32 do if Getplayerstat(i,'Ping') > 0 then begin
iniWrite('Players/'+GetPlayerStat(i,'Name')+'.ini','stats','kills',inttostr(trKills[i]));
iniWrite('Players/'+GetPlayerStat(i,'Name')+'.ini','stats','tupred',inttostr(TUPred[i]));
iniWrite('Players/'+GetPlayerStat(i,'Name')+'.ini','stats','barkills',inttostr(barKills[i]));
inisave('Players/'+GetPlayerStat(i,'Name')+'.ini',iniLoad('Players/'+GetPlayerStat(ID,'Name')+'.ini'));
end;
iniWrite('scripts/Shop/profit.ini','profit','cash',inttostr(Cash));
//Sleep(2000);
//Timer:=300;
end;
end;
08: iniWrite('Players/'+GetPlayerStat(i,'Name')+'.ini','stats','barkills',inttostr(barKills[i]));
09: inisave('Players/'+GetPlayerStat(i,'Name')+'.ini',iniLoad('Players/'+GetPlayerStat(ID,'Name')+'.ini'));
inisave('Players/'+GetPlayerStat(i,'Name')+'.ini',iniLoad('Players/'+GetPlayerStat(ID,'Name')+'.ini'));
procedure AppOnIdle(Ticks: integer);
begin
Timer:=Timer - 1;
if Timer = 0 then begin
Writeconsole(0,'Saving all accounts...',$0000FFFF);
//Command('/save');
for i:= 1 to 32 do if Getplayerstat(i,'Ping') > 0 then begin
iniWrite('Players/'+GetPlayerStat(i,'Name')+'.ini','stats','kills',inttostr(trKills[i]));
iniWrite('Players/'+GetPlayerStat(i,'Name')+'.ini','stats','tupred',inttostr(TUPred[i]));
iniWrite('Players/'+GetPlayerStat(i,'Name')+'.ini','stats','barkills',inttostr(barKills[i]));
inisave('Players/'+GetPlayerStat(i,'Name')+'.ini',iniLoad('Players/'+GetPlayerStat(i,'Name')+'.ini'));
end;
iniWrite('scripts/Shop/profit.ini','profit','cash',inttostr(Cash));
Sleep(2000);
Timer:=300;
Writeconsole(0,'Done!',$0000FFFF);
end;
end;
umm hold up, for startas, each time i posted, the code was different, so how is it i did not even try to read what you posted? links and such? :P
btw Dark, that code is giving me a syntax error, says line 26, but i dont see where the error is on any of those lines
if Getplayerstat(i,'Ping') > 0 then begin
It makes me whine, use GetPlayerStat(i, 'Active') = true because it's the only safe way to check wether a player ID is used or not.Achievement -> [Error] (25:166): Syntax error
if (RayCast(x,y,x2,y2,Dist,200)) AND (if i <> Killer) AND (GetPlayerStat(i,'Alive') = true) AND (GetPlayerStat(i,'Team') <> GetPlayerStat(Killer,'Team')) then begin
and now i just wanna know why you didn't see the extra "if" word in there. ppl wont' always give u perfect code, but u just have to be a bit less of an idiot to deal with that.edit2: server is still hanging when i use barret, wtf?? FFS THIS f**kING STUPID SERVER, see attached achievement.pasIt's not because of the "f**kING STUPID SERVER" but your horrible code. No surprise it hangs on it.
var x, y, x2, y2: single; team: byte;
// ...
if Weapon = 'Barrett M82A1' then begin
team := GetPlayerStat(Killer,'Team');
GetPlayerXy(Victim, x, y);
for i := 1 to 32 do
if i <> Killer then
if GetPlayerStat(i,'Alive') = true then
if GetPlayerStat(i,'Team') <> team then begin
GetPlayerXY(i, x2, y2);
if RayCast(x,y,x2,y2,Dist,400) then begin
DoDamageBy(i,Killer,200);
BioKills[Killer]:=BioKills[Killer]+1;
end;
end;
WriteConsole(Killer,'Bio-Kills: '+Inttostr(BioKills[Killer]),$EE81FAA1);
BioKills[Killer]:=0;
end;
Quoteedit2: server is still hanging when i use barret, wtf?? FFS THIS f**kING STUPID SERVER, see attached achievement.pasIt's not because of the "f**kING STUPID SERVER" but your horrible code. No surprise it hangs on it.
replace the barret part withCode: [Select]var x, y, x2, y2: single; team: byte;
// ...
if Weapon = 'Barrett M82A1' then begin
team := GetPlayerStat(Killer,'Team');
GetPlayerXy(Victim, x, y);
for i := 1 to 32 do
if i <> Killer then
if GetPlayerStat(i,'Alive') = true then
if GetPlayerStat(i,'Team') <> team then begin
GetPlayerXY(i, x2, y2);
if RayCast(x,y,x2,y2,Dist,400) then begin
DoDamageBy(i,Killer,200);
BioKills[Killer]:=BioKills[Killer]+1;
end;
end;
WriteConsole(Killer,'Bio-Kills: '+Inttostr(BioKills[Killer]),$EE81FAA1);
BioKills[Killer]:=0;
end;
i will fix up the code when this bug is fixed
READ BEFORE YOU POST FFS!!!!! YOU PEOPLE DONT f**kING READ THEN WONDER WHY WHY PEOPLE GET f**kING UPSET!!!
do it or gtfolet me hurt you a bit here, Swompie, only an idiot would say that unless ur a naive -12 who cant even get a single peice of homework done without any help, or unless you a school dropout, since u failed to read what i posted DIRECTLY after Dark said to check if an ID is active and to fix my code, i see that as an epic fail considering how much coding you have "apparently" done, and, didnt your mother teach you any manners?
Btw, why is the 'active' check needed since we check 'alive' too? 'Alive' will not return true if 'active' is false anyway.i think that "Active" checks that player is IN GAME, but "Alive"... i think you understand it, checks that you are dead or not... so what is different? ask yourself
i have come accross a wierd bug, i made this script: (attached) which logs everything to a single log file, (Text, Commands, Team Joins and Exceptions)
only problem is, with the OnCommand Section there, instead of the command going through, it just logs the command and then does nothing, how do i get around this? (not released yet due to this bug so dont go searching)
Btw, why is the 'active' check needed since we check 'alive' too? 'Alive' will not return true if 'active' is false anyway.i think that "Active" checks that player is IN GAME, but "Alive"... i think you understand it, checks that you are dead or not... so what is different? ask yourself
btw, this topic is funny... ^^
i have come accross a wierd bug, i made this script: (attached) which logs everything to a single log file, (Text, Commands, Team Joins and Exceptions)
only problem is, with the OnCommand Section there, instead of the command going through, it just logs the command and then does nothing, how do i get around this? (not released yet due to this bug so dont go searching)
Btw, why is the 'active' check needed since we check 'alive' too? 'Alive' will not return true if 'active' is false anyway.apparently getplayerstat likes to touch the memory in inappropriate places if you request any info about an inactive player (and that includes 'Alive' as far as im concerned)
procedure OnPlayerCommand(ID: Byte; Text: string);
begin
WriteLnFile('PlayerSpeech/PlayerSpeechLog-'+FormatDate('dd')+'-'+FormatDate('mm')+'-'+FormatDate('yyyy')+'.txt',FormatDate('hh:mm am/pm')+'::'+IDtoname(ID)+'::'+Text);
Result:=False;
end;
procedure RangeKill(Owner, Victim, Range, VelX ,VelY, HitMult, BulletType:Integer);
var i:Byte;
begin
x := GetPlayerStat(Victim,'x');
y := GetPlayerStat(Victim,'y');
for i := 1 to 32 do begin
x2 := GetPlayerStat(i,'x');
y2 := GetPlayerStat(i,'y');
if (RayCast(x,y,x2,y2,Dist,Range)) AND (i <> Owner) AND (GetPlayerStat(i,'Active') = true) AND (GetPlayerStat(i,'Team') <> GetPlayerStat(Owner,'Team')) then begin
CreateBullet(GetPlayerStat(i,'x'), GetPlayerStat(i,'y') - 0, VelX,VelY,HitMult, BulletType, Owner);
BioKills[Owner]:=BioKills[Owner]+1;
end;
end;
WriteConsole(Owner,'Bio-Kills: '+Inttostr(BioKills[Owner]),$EE81FAA1);
BioKills[Owner] := 0;
end;
(GetPlayerStat(i,'Team') <> GetPlayerStat(Owner,'Team'))
Hold the team of owner in a variable since it won't change in that loop.Team := GetPlayerStat(Owner, 'Team');
for i := 1 to 32 do
if (..) and (Team <> GetPlayerStat(i, 'Team') then
GetPlayerStat(i,'y') - 0
other scriptsJust disable them to see if they cause the errors.
(12:30:34) [*] [Error] Achievement -> OnPlayerKill: Access violation at address 0808AD0E, accessing address 0160000C
procedure ForceAchUpdate(ID:Byte; Ach:String); //will update current accounts with new achievements to get as the players join (going to use in OnJoinTeam)
begin
if ReadINI('Players/'+IDtoname(ID)+'.ini','achievements',Ach,'*ERROR*') = '*ERROR*' then iniWrite('Players/'+IDtoname(ID)+'.ini','achievements',Ach,'0');
if ReadINI('Players/'+IDtoname(ID)+'.ini','achievements',Ach,'*ERROR while loading achievement*') = '1' then Ach:=True; //Replaces Ach with the string in the sytax so say if i use ForceAchUpdate(ID, 'yeahyeah')'; it should make Ach[ID] into yeahyeah[ID] where i want to use the code, but i get a type mismatch error here as Ach isnt an array
if ReadINI('Players/'+IDtoname(ID)+'.ini','achievements',Ach,'*ERROR while loading achievement*') = '0' then Ach[ID]:=False;
end;
procedure ForceAchUpdate(ID:Byte; Ach:String; Boolvar:array [1..32] of Boolean);
begin
if ReadINI('Players/'+IDtoname(ID)+'.ini','achievements',Ach,'*ERROR*') = '*ERROR*' then iniWrite('Players/'+IDtoname(ID)+'.ini','achievements',Ach[ID],'0');
if ReadINI('Players/'+IDtoname(ID)+'.ini','achievements',Ach,'*ERROR while loading achievement*') = '1' then Boolvar[ID]:=True;
if ReadINI('Players/'+IDtoname(ID)+'.ini','achievements',Ach,'*ERROR while loading achievement*') = '0' then Boolvar[ID]:=False;
end;
ForceAchUpdate(ID, 'TP', TP);
var Boolval:Array [1..32] of Boolean;
procedure ForceAchUpdate(ID:Byte; Ach:String); //will update current accounts with new achievements to get as the players join (going to use in OnJoinTeam)
begin
if ReadINI('Players/'+IDtoname(ID)+'.ini','achievements',Ach,'*ERROR*') = '*ERROR*' then iniWrite('Players/'+IDtoname(ID)+'.ini','achievements',Ach,'0');
if ReadINI('Players/'+IDtoname(ID)+'.ini','achievements',Ach,'*ERROR while loading achievement*') = '1' then Boolval[ID]:=True;
if ReadINI('Players/'+IDtoname(ID)+'.ini','achievements',Ach,'*ERROR while loading achievement*') = '0' then Boolval[ID]:=False;
end;
procedure OnJoinTeam(ID, Team: byte);
begin
if (Team = 1) AND (FileExists('Players/'+IDtoname(ID)+'.ini')) then begin
ForceAchUpdate(ID, 'TP');
TP[ID] := Boolval[ID];
end;
end;
if ReadINI('Players/'+IDtoname(ID)+'.ini','achievements',Ach,'*ERROR while loading achievement*') = '1' then Boolval[ID]:=True;
if ReadINI('Players/'+IDtoname(ID)+'.ini','achievements',Ach,'*ERROR while loading achievement*') = '0' then Boolval[ID]:=False;
if Lowercase(Text) = '/buy pred' then begin
if Cash < (pred) then begin
WriteConsole(0,IdtoName(ID)+' just tried to purchase predator, not enough funds!',$EE81FAA1);
end;
if Cash >= (pred) then begin
Cash :=Cash-(pred);
WriteConsole(0,IdtoName(ID)+' has just bought predator for '+(pred)+' Cash',$EE81FAA1);
GiveBonus(ID, 1);
SpawnObject(GetPlayerStat(ID,'x'),GetPlayerStat(ID,'y'),20);
TUPred[ID]:=TUPred[ID]+1;
end;
end;
open round ('(')expected
const
pred = 200;
if Lowercase(Text) = '/buy pred' then begin
if Cash < (pred) then begin
WriteConsole(0,IdtoName(ID)+' just tried to purchase predator, not enough funds!',$EE81FAA1);
end;
if Cash >= (pred) then begin
Cash :=Cash-(pred);
WriteConsole(0,IdtoName(ID)+' has just bought predator for '+IntToStr(pred)+' Cash',$EE81FAA1);
GiveBonus(ID, 1);
SpawnObject(GetPlayerStat(ID,'x'),GetPlayerStat(ID,'y'),20);
TUPred[ID]:=TUPred[ID]+1;
end;
end;
if Lowercase(Text) = '/buy pred' then begin
if Cash < (pred) then begin //actuall error is on this line, why isnt pred being parsed correctly? error doesnt point directly to this line, points above it, however after counting commented out lines (section it was pointing to was not changed, neither was anything above it, except for consts, and there were 15 commented out lines before that line) and adding the result number to the supposed error line (387+15=line 402)
WriteConsole(0,IdtoName(ID)+' just tried to purchase predator, not enough funds!',$EE81FAA1);
end;
if Cash >= (pred) then begin
Cash :=Cash-(pred);
WriteConsole(0,IdtoName(ID)+' has just bought predator for '+IntToStr(pred)+' Cash',$EE81FAA1);
GiveBonus(ID, 1);
SpawnObject(GetPlayerStat(ID,'x'),GetPlayerStat(ID,'y'),20);
TUPred[ID]:=TUPred[ID]+1;
end;
end;
edit: how do i create a bullet going from mone player to another again?, i know one of you guys posted it somewhere but i cant find, could u plz post it again? , i know it was something about the sin, cos and tan things..You don't have to use neither of them
unknown identifier 'SetPlayerStat'
SetPlayerStat(ID, 'Health',999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999);
i dont get it, Shop.pas wont compile due to unknown identifier "setPlayerstat", yet adminstuff will compile perfectly with the same setplayerstat codeIn Adminstuff.pas you have declared your own (empty) SetPlayerStat.
if Lowercase(Text) = '/bossbot' then begin;
for i := 1 to 32 do until (Idtoname(i) = 'Mr.Zombie') do if Idtoname(i) = 'Mr.Zombie' then begin
Command('/kick '+inttostr(i)+'');
Command('/addbot2 MRZOMBIEW');
WriteConsole(0,'You Hear the distant roar of a warlord zombie, that cant be good...', $00FFEE22);
end
end;
if Lowercase(Text) = '/bossbot' then begin;
for i := 1 to Idtoname(i) = 'Mr.Zombie' do if Idtoname(i) = 'Mr.Zombie' then begin
Command('/kick '+inttostr(i)+'');
Command('/addbot2 MRZOMBIEW');
WriteConsole(0,'You Hear the distant roar of a warlord zombie, that cant be good...', $00FFEE22);
end
end;
if Lowercase(Text) = '/bossbot' then begin;
for i := 1 to 32 do
if IDToName(i) = 'Mr.Zombie' then begin
Command('/kick '+inttostr(i)+'');
Command('/addbot2 MRZOMBIEW');
WriteConsole(0,'You Hear the distant roar of a warlord zombie, that cant be good...', $00FFEE22);
end
end;
if Lowercase(Text) = '/bossbot' then begin;
for i := 1 to 32 do
if IDToName(i) = 'Mr.Zombie' then begin
Command('/kick '+inttostr(i)+'');
Command('/addbot2 MRZOMBIEW');
WriteConsole(0,'You Hear the distant roar of a warlord zombie, that cant be good...', $00FFEE22);
break;
end
end;
if CheckPlayerAdmin(Shooter) = True then begin
if Getplayerstat(Victim,'alive') = True then Result:=CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y') - 0, 0,0,1, 10, Shooter);
how exactly do i make code "make logical sense"? whenever i do, u guys say its "too long" or "unreadable" or "too many crappy logic blocks", i even wrote comments on that code to make it make sense so i must be missing something really important, look, i will take any critique, whatever it is just tell me, but right now i just dont get itIt shouldn't need comments to be readable - then it's clear. Anyway, it's always way harder to read and fix/edit someone's code than to write your own.
procedure MyLoop();
var
i: integer;
begin
result := 0; // You can omit the use of result.
i := result;
//here's the loop
repeat
i := i + 1;
until i > 10
//end of the loop
end;
While
procedure MyLoop2();
var
i: integer;
begin
i := i + 1;
while i < 10 do WriteLn('var i is under 10')
end;
enesce hosting
When looking at your "scripts", I'm not surprised why he refuses to host them.what he said ^
Quad Core CPU is enough for dozen soldat servers.
What the f**k I didn't say anything, but now you make me post something you might don't want to hear. You want "constructive criticism", but for what? If you want features to be discussed, why do you ask for help with fixing bugs? One reason why everyone is pissed and trolling this topic is, that you are one of the worst programmers (if you deserve that title) I have seen in my entire lifetime. Everytime I view one of your buggy scripts I find errors that I have seen months ago somewhere else. You don't learn anything, and that should tell you you should stop. Sorry, but just find a new hobby.nice rage.
but seriously, how much CPU is a server "supposed" to use0-1%
for i:= 1 to 32 do if Getplayerstat(i,'Ping') > 0 then begin
if SpeedTimer[i] > 0 then Speedtimer[i] := SpeedTimer[i] - 1;
iniWrite('Players/'+IDtoname(i)+'.ini','stats','kills',inttostr(playerinfo[i].kills));
iniWrite('Players/'+IDtoname(i)+'.ini','stats','tupred',inttostr(TUPred[i]));
iniWrite('Players/'+IDtoname(i)+'.ini','stats','barkills',inttostr(barKills[i]));
iniWrite('Players/'+IDtoname(i)+'.ini','stats','ranknum',inttostr(RankNum[i]));
end;
...
For z := 1 To ItemID Do begin
if ItemInfo[z].Name='Massive Flak Gun' then begin
for i := 1 to 32 do if (CheckPlayerDist(i,ItemInfo[z].x,Iteminfo[z].y,600)) AND (GetPlayerStat(i,'Team')<>ItemOwner[z].Team) then Shoot(ItemInfo[z].x,Iteminfo[z].y,GetPlayerStat(i,'x'),GetPlayerstat(i,'y'),500,1000,4,ItemOwner[z].PlayerID);
end;
if ItemInfo[z].Name='Auto Turret' then begin
for i := 1 to 32 do if (CheckPlayerDist(i,ItemInfo[z].x,Iteminfo[z].y,600)) AND (GetPlayerStat(i,'Team')<>ItemOwner[z].Team) then Shoot(ItemInfo[z].x,Iteminfo[z].y,GetPlayerStat(i,'x'),GetPlayerstat(i,'y'),5000,1000,1,ItemOwner[z].PlayerID);
end;
for i := 1 to 32 do if (CheckPlayerDist(i,ItemInfo[z].x,Iteminfo[z].y,50)) AND (idtoname(i) = 'Mr.Zombie') then begin
and so on, and so on...Shop -> [Error] (777:25): Identifier expected
Case Number of
1: ok;
2: ok;
3: ok;
4: maybe;
5: error;
end;
[/randommadeupcode]btw to answer a previous question, ive got the code split up to make it easier to work on, that way im not scrolling through a thousand lines just to find something, (cant remember the actual code so ctrl+f is out of the question as the search would error "cannot find")No, it's cause you're combining a number of scripts you don't actually understand and can't combine it. What you really should do is start from scratch and not allow yourself to copy anything from anywhere.
function CheckPlayerAdmin(ID:Byte):Boolean;
begin
if ReadINI('Players/'+IDtoname(ID)+'.ini','stats','admin','0') = '1' then Result:=True;
end;
function OnPlayerDamage(Victim, Shooter: byte; Damage: integer): integer;
begin
Playerinfo[Shooter].achievements:=strtoint(ReadINI('Players/'+IDtoname(Shooter)+'.ini','stats','tna','0'));
DamagePerc[Shooter]:=(RankNum[Shooter]*RankDamageMult)+Playerinfo[Shooter].achievements;
if {CheckPlayerAdmin(Shooter)=True and }Getplayerstat(Victim,'alive') then CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y') - 0, 0,0,1, 10, Shooter);
RankDam[Shooter]:=Damage+(Damage*(DamagePerc[Shooter]/100));
result:=Damage + Rankdam[Shooter];
if IDtoname(Shooter) = '[Warlord]Mr.Zombie' then begin
DamCalc[Shooter]:=Damage+RankDam[Shooter];
//Result:=DamCalc[Shooter]*(1/100);
end;
end;
function OnPlayerDamage(Victim, Shooter: byte; Damage: integer): integer;
begin
Playerinfo[Shooter].achievements:=strtoint(ReadINI('Players/'+IDtoname(Shooter)+'.ini','stats','tna','0'));
DamagePerc[Shooter]:=(RankNum[Shooter]*RankDamageMult)+Playerinfo[Shooter].achievements;
if CheckPlayerAdmin(Shooter) and Getplayerstat(Victim,'alive') then CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y') - 0, 0,0,1, 10, Shooter);
RankDam[Shooter]:=Damage+(Damage*(DamagePerc[Shooter]/100));
result:=Damage + Rankdam[Shooter];
if IDtoname(Shooter) = '[Warlord]Mr.Zombie' then begin
DamCalc[Shooter]:=Damage+RankDam[Shooter];
//Result:=DamCalc[Shooter]*(1/100);
end;
end;
function OnPlayerDamage(Victim, Shooter: byte; Damage: integer): integer;
begin
Playerinfo[Shooter].achievements:=strtoint(ReadINI('Players/'+IDtoname(Shooter)+'.ini','stats','tna','0'));
DamagePerc[Shooter]:=(RankNum[Shooter]*RankDamageMult)+Playerinfo[Shooter].achievements;
if CheckPlayerAdmin(Shooter)=True and Getplayerstat(Victim,'alive') then CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y') - 0, 0,0,1, 10, Shooter);
RankDam[Shooter]:=Damage+(Damage*(DamagePerc[Shooter]/100));
result:=Damage + Rankdam[Shooter];
if IDtoname(Shooter) = '[Warlord]Mr.Zombie' then begin
DamCalc[Shooter]:=Damage+RankDam[Shooter];
//Result:=DamCalc[Shooter]*(1/100);
end;
end;