0 Members and 1 Guest are viewing this topic.
var pname: string; money: array[1..32] of integer; statcost: integer; giveid:integer; give,ammount,player:string;procedure ActivateServer(); begin statcost := 2000; end;procedure OnJoinGame(ID, Team: byte); begin money[ID] := 50; writeConsole(ID, 'Your Money is: $' + inttostr(money[ID]), RGB(0,255,255)); writeConsole(ID, 'This server is running Weapon_Shop by: Corl45' + inttostr(money[ID]), RGB(0,255,255)); writeConsole(ID, 'Type /shop for shop and /money for your money.' + inttostr(money[ID]), RGB(0,255,255)); end;procedure OnPlayerKill(Killer, Victim: byte;Weapon: string); begin if Killer = Victim then begin writeConsole(Killer, 'you cant kill yourself for money you silly bear', RGB(0, 255, 255)); end else begin money[Killer] := money[Killer]+100; writeConsole(Killer, 'You just got $100 your money is now: $' + inttostr(money[Killer]), RGB(0, 255, 255)); end; end;function OnPlayerCommand(ID: Byte; Text: string): boolean; begin give := GetPiece(LowerCase(Text), ' ', 0); ammount := GetPiece(LowerCase(Text), ' ', 1); player := GetPiece(Text, ' ', 2); if give = '/give' then begin if money[ID] > strtoint(ammount) then begin giveid := NameToID(player); if giveid > 0 then begin money[ID] := money[ID] - strtoint(ammount); money[giveid] := money[giveid] + strtoint(ammount); writeconsole(ID, 'You gave $' + ammount + ' to: ' + IDToName(giveid) + ', Your money is now: $' + inttostr(money[ID]) , RGB(0,255,255)); writeconsole(giveid, 'You recived $' + ammount + ' from: ' + IDToName(ID) + ', Your money is now: $' + inttostr(money[giveid]), RGB(0,255,255)); end else begin writeconsole(ID, 'That person does not exist.', RGB(0,255,255)); end; end else begin writeconsole(ID, 'You don''t have enough money',RGB(0,255,255)); end; end; if regExpMatch('^/(money|moneys)$', Text) then begin writeConsole(ID, 'Your money is: $' + inttostr(money[ID]), RGB(0, 255, 255)); end; if regExpMatch('^/(commands|shop|spawn|help)$', Text) then begin writeConsole(ID, '-----Weapon Costs------', $0099CC00); writeConsole(ID, 'commands:', $0099CC00); writeConsole(ID, '/stat-Turret $2000', RGB(255,0,0)); writeConsole(ID, '-------------END----------------', RGB(255,0,0)); end;if regExpMatch('^/(stationary|stat|turrent)$', Text) then begin if money[ID] >= statcost then begin money[ID] := money[ID] - statcost; SpawnObject(GetPlayerStat(ID,'x')+20,GetPlayerStat(ID,'y')-20,15); writeconsole(ID, 'You bought a Stat Gun for $2000, you have $' + inttostr(money[ID]), RGB(0,255,255)); end else begin writeconsole(ID, 'You do not have enough money', RGB(0,255,255)); end; end;
10-04-05 18:07:03 Console Log Started10-04-05 18:07:03 Loaded weapons mod "Default mod v1.5"10-04-05 18:07:03 Welcome to Soldat 1.5.010-04-05 18:07:03 [*] ScriptCore v2.6 loaded! Found 3 scripts...10-04-05 18:07:03 [*] Compiling loot -> loot.pas...10-04-05 18:07:03 [*] Compiling rule -> rule.pas...10-04-05 18:07:03 [*] Compiling Weapon_shop -> Weapon_shop.pas...10-04-05 18:07:03 [*] Weapon_shop -> [Error] (105:10): Identifier expected10-04-05 18:07:03 [*] Compilation Failed.10-04-05 18:07:03 Shutting down server...10-04-05 18:07:03 Shutting down admin server...10-04-05 18:07:03 Shutting down ScriptCore...
[...] Although, you missed an "End;" at the end. How ironic. Try this one.[...]
var pname: string; money: array[1..32] of integer; statcost: integer; giveid:integer; give,ammount,player:string;procedure ActivateServer(); begin statcost := 30; end;procedure OnJoinGame(ID, Team: byte); begin money[ID] := 1; writeConsole(ID, 'Your Money is: $' + inttostr(money[ID]), $0099CC00); writeConsole(ID, 'Do /shop to see the shop, do /money to see your money !' + inttostr(money[ID]), $0099CC00); end;procedure OnPlayerKill(Killer, Victim: byte;Weapon: string); begin if Killer = Victim then begin writeConsole(Killer, 'you cant kill yourself for money !', $0099CC00); end else begin money[Killer] := money[Killer]+1; writeConsole(Killer, 'You just got $1 your money is now: $' + inttostr(money[Killer]), $0099CC00); end; end;function OnPlayerCommand(ID: Byte; Text: string): boolean; begin give := GetPiece(LowerCase(Text), ' ', 0); ammount := GetPiece(LowerCase(Text), ' ', 1); player := GetPiece(Text, ' ', 2); if give = '/give' then begin if money[ID] > strtoint(ammount) then begin giveid := NameToID(player); if giveid > 0 then begin money[ID] := money[ID] - strtoint(ammount); money[giveid] := money[giveid] + strtoint(ammount); writeconsole(ID, 'You gave $' + ammount + ' to: ' + IDToName(giveid) + ', Your money is now: $' + inttostr(money[ID]) , $0099CC00); writeconsole(giveid, 'You recived $' + ammount + ' from: ' + IDToName(ID) + ', Your money is now: $' + inttostr(money[giveid]), $0099CC00); end else begin writeconsole(ID, 'That person does not exist.', $0099CC00); end; end else begin writeconsole(ID, 'You don''t have enough money', $0099CC00); end; end; if regExpMatch('^/(money|moneys)$', Text) then begin writeConsole(ID, 'Your money is: $' + inttostr(money[ID]), $0099CC00)); end; if regExpMatch('^/(commands|shop|spawn|help)$', Text) then begin writeConsole(ID, '#############SHOP###############', $0099CC00); writeConsole(ID, '#commands: #', $0099CC00); writeConsole(ID, '#/stat-Turret $30 #', $0099CC00); writeConsole(ID, '#More will come :P #', $0099CC00); writeConsole(ID, '#############END################', $0099CC00); end;if regExpMatch('^/(stationary|stat|turrent)$', Text) then begin if money[ID] >= statcost then begin money[ID] := money[ID] - statcost; SpawnObject(GetPlayerStat(ID,'x')+20,GetPlayerStat(ID,'y')-20,15); writeconsole(ID, 'You bought a Stat Gun for $30, you have $' + inttostr(money[ID]), $0099CC00); end else begin writeconsole(ID, 'You do not have enough money', RGB(0,255,255)); end; end;end;
10-04-05 21:01:22 Console Log Started10-04-05 21:01:22 Loaded weapons mod "Default mod v1.5"10-04-05 21:01:22 Welcome to Soldat 1.5.010-04-05 21:01:22 [*] ScriptCore v2.6 loaded! Found 3 scripts...10-04-05 21:01:22 [*] Compiling loot -> loot.pas...10-04-05 21:01:22 [*] Compiling rule -> rule.pas...10-04-05 21:01:22 [*] Compiling Weapon_shop -> Weapon_shop.pas...10-04-05 21:01:22 [*] Weapon_shop -> [Error] (77:78): Identifier expected10-04-05 21:01:22 [*] Compilation Failed.10-04-05 21:01:22 Shutting down server...10-04-05 21:01:22 Shutting down admin server...10-04-05 21:01:23 Shutting down ScriptCore...
ConstColor = $FFFFFF;
constColor = $0099CC; //Color to be used.var pname: string; money: array[1..32] of integer; statcost: integer; giveid:integer; give,ammount,player:string;procedure ActivateServer(); begin statcost := 30; end;procedure OnJoinGame(ID, Team: byte); begin money[ID] := 1; writeConsole(ID, 'Your Money is: $' + inttostr(money[ID]),Color); writeConsole(ID, 'Do /shop to see the shop, do /money to see your money !' + inttostr(money[ID]), Color); end;procedure OnPlayerKill(Killer, Victim: byte;Weapon: string); begin if Killer = Victim then begin writeConsole(Killer, 'you cant kill yourself for money !', Color); end else begin money[Killer] := money[Killer]+1; writeConsole(Killer, 'You just got $1 your money is now: $' + inttostr(money[Killer]), Color); end; end;function OnPlayerCommand(ID: Byte; Text: string): boolean; begin give := GetPiece(LowerCase(Text), ' ', 0); ammount := GetPiece(LowerCase(Text), ' ', 1); player := GetPiece(Text, ' ', 2); if give = '/give' then begin if money[ID] > strtoint(ammount) then begin giveid := NameToID(player); if giveid > 0 then begin money[ID] := money[ID] - strtoint(ammount); money[giveid] := money[giveid] + strtoint(ammount); writeconsole(ID, 'You gave $' + ammount + ' to: ' + IDToName(giveid) + ', Your money is now: $' + inttostr(money[ID]) , Color); writeconsole(giveid, 'You recived $' + ammount + ' from: ' + IDToName(ID) + ', Your money is now: $' + inttostr(money[giveid]), Color); end else begin writeconsole(ID, 'That person does not exist.', Color); end; end else begin writeconsole(ID, 'You don''t have enough money', Color); end; end; if regExpMatch('^/(money|moneys)$', Text) then begin writeConsole(ID, 'Your money is: $' + inttostr(money[ID]), Color); end; if regExpMatch('^/(commands|shop|spawn|help)$', Text) then begin writeConsole(ID, '#############SHOP###############', Color); writeConsole(ID, '#commands: #', Color); writeConsole(ID, '#/stat-Turret $30 #', Color); writeConsole(ID, '#More will come :P #', Color); writeConsole(ID, '#############END################', Color); end;if regExpMatch('^/(stationary|stat|turrent)$', Text) then begin if money[ID] >= statcost then begin money[ID] := money[ID] - statcost; SpawnObject(GetPlayerStat(ID,'x')+20,GetPlayerStat(ID,'y')-20,15); writeconsole(ID, 'You bought a Stat Gun for $30, you have $' + inttostr(money[ID]), Color); end else begin writeconsole(ID, 'You do not have enough money', Color); end; end;end;
@squiddy - its $AARRGGBB so 8 makes sense. i forget if alpha is enabled for WriteConsole. i know at one point it was for DrawText but latter removed (i think; long time ago i messed with it).
Those two answers above
// Portable Sentry Gun Script// by Super Vegeta// super_vegeta@wp.pl// www.svgames.prv.pl// v.1.0 - 16.11.2008const psgammo = 50; //psg ammoconst psgpowa = 1; //psg powerconst psgtype = 14; //psg bullet typeconst psgrang = 666; //psg rangeconst psgspee = 50; //psg bullet speedconst maxpsg = 5; //max psgs on mapvar sgx,sgy:array[1..maxpsg] of single;var sga,sgo,sgt:array[1..maxpsg] of byte;var sgd:array[1..maxpsg] of boolean;procedure OnMapChange(newmap:string);var n:byte;beginfor n:=1 to maxpsg do begin sgd[n]:=false; end; end;procedure OnLeaveGame(ID,team:byte;kicked:boolean);var n:byte;beginfor n:=1 to maxpsg do begin if sgo[n]=ID then sgd[n]:=false; end;end;procedure apponidle(ticks:integer);var n,k:byte; var x,y,dista:single;beginfor n:=1 to maxpsg do beginif sgd[n]=true then beginCreateBullet(sgx[n],sgy[n],0,0,0,5,sgo[n]);for k:=1 to 32 do begingetplayerxy(k,x,y);if (getplayerstat(k,'team')<>sgt[n]) and (getplayerstat(k,'alive')=true) and (raycast(sgx[n],sgy[n],x,y,dista,psgrang)=true) and (dista<=psgrang) then beginx:=((x-sgx[n]) / dista)*psgspee; y:=((y-sgy[n]) / dista)*psgspee;CreateBullet(sgx[n],sgy[n],x,y,psgpowa,psgtype,sgo[n]); sga[n]:=sga[n]-1;if sga[n]=0 then begin sgd[n]:=false; Writeconsole(sgo[n],'One of your sentry guns ran out of ammo.',$0000FF00); end;break;end;end;end;end;end;procedure placesentry(x,y:single;ID,team:byte);var n,f:byte;beginif getplayerstat(ID,'Ground')=true then beginf:=maxpsg;for n:=1 to maxpsg do beginif sgd[n]=true then f:=f-1;end;if f=0 then DrawText(ID,'Maximum of '+inttostr(maxpsg)+' sentry guns on map reached.',250,RGB(0,255,0),0.10,150,400) else beginfor n:=1 to maxpsg do beginif sgd[n]=false then break;end;sgx[n]:=x; sgy[n]:=y; sgo[n]:=ID; sgt[n]:=team; sga[n]:=psgammo; sgd[n]:=true;DrawText(ID,'Sentry gun placed!',250,RGB(0,255,0),0.1,75,350);end;end else DrawText(ID,'You are in mid-air!',250,RGB(0,255,0),0.10,220,400);end;function OnPlayerCommand(ID:byte;text:string):boolean;begintext:=lowercase(text);if text='/psg' then placesentry(getplayerstat(ID,'x'),getplayerstat(ID,'y'),ID,getplayerstat(ID,'team'));result:=false;end;
constColor = $0099CC; //Color to be used.var pname: string; money: array[1..32] of integer; statcost:integer; helpcost:integer; giveid:integer; give,ammount,player:string;procedure ActivateServer(); begin statcost := 30; helpcost := 20; end;procedure OnJoinGame(ID, Team: byte); begin money[ID] := 1; writeConsole(ID, 'Your Money is: $' + inttostr(money[ID]),Color); writeConsole(ID, 'Do /shop to see the shop, do /money to see your money !' + inttostr(money[ID]), Color); end;procedure OnPlayerKill(Killer, Victim: byte;Weapon: string); begin if Killer = Victim then begin writeConsole(Killer, 'you cant kill yourself for money !', Color); end else begin money[Killer] := money[Killer]+1; writeConsole(Killer, 'You just got $1 your money is now: $' + inttostr(money[Killer]), Color); end; end;function OnPlayerCommand(ID: Byte; Text: string): boolean; begin give := GetPiece(LowerCase(Text), ' ', 0); ammount := GetPiece(LowerCase(Text), ' ', 1); player := GetPiece(Text, ' ', 2); if give = '/give' then begin if money[ID] > strtoint(ammount) then begin giveid := NameToID(player); if giveid > 0 then begin money[ID] := money[ID] - strtoint(ammount); money[giveid] := money[giveid] + strtoint(ammount); writeconsole(ID, 'You gave $' + ammount + ' to: ' + IDToName(giveid) + ', Your money is now: $' + inttostr(money[ID]) , Color); writeconsole(giveid, 'You recived $' + ammount + ' from: ' + IDToName(ID) + ', Your money is now: $' + inttostr(money[giveid]), Color); end else begin writeconsole(ID, 'That person does not exist.', Color); end; end else begin writeconsole(ID, 'You don''t have enough money', Color); end; end; if regExpMatch('^/(money|moneys)$', Text) then begin writeConsole(ID, 'Your money is: $' + inttostr(money[ID]), Color); end; if regExpMatch('^/(commands|shop|spawn|help)$', Text) then begin writeConsole(ID, '#############SHOP####################', Color); writeConsole(ID, '#commands: #', Color); writeConsole(ID, '#/stat-Turret $30(spawn a turret) #', Color); writeConsole(ID, '#/merc-helper $20(Spawn a mercenary)#', Color); writeConsole(ID, '#More will come :P #', Color); writeConsole(ID, '#############END#####################', Color); end;if regExpMatch('^/(stationary|stat|turrent)$', Text) then begin if money[ID] >= statcost then begin money[ID] := money[ID] - statcost; SpawnObject(GetPlayerStat(ID,'x')+20,GetPlayerStat(ID,'y')-20,15); writeconsole(ID, 'You bought a Stat Gun for $30, you have $' + inttostr(money[ID]), Color); end else begin writeconsole(ID, 'You do not have enough money', Color); end; end;end;if regExpMatch('^/(help|merc|mercenary)$', Text) then begin if money[ID] >= helpcost then begin money[ID] := money[ID] - helpcost; Command('/addbot1 mercenary') writeconsole(ID, 'Youve engage a mercenary for $20, you have $' + inttostr(money[ID]), Color); end else begin writeconsole(ID, 'You do not have enough money', Color); end; end;end;
10-04-06 10:40:43 Console Log Started10-04-06 10:40:43 Loaded weapons mod "Default mod v1.5"10-04-06 10:40:43 Welcome to Soldat 1.5.010-04-06 10:40:43 [*] ScriptCore v2.6 loaded! Found 3 scripts...10-04-06 10:40:43 [*] Compiling loot -> loot.pas...10-04-06 10:40:43 [*] Compiling rule -> rule.pas...10-04-06 10:40:43 [*] Compiling Weapon_shop -> Weapon_shop.pas...10-04-06 10:40:43 [*] Weapon_shop -> [Hint] (43:10): Variable 'Result' never used10-04-06 10:40:43 [*] Weapon_shop -> [Error] (119:1): 'BEGIN' expected10-04-06 10:40:43 [*] Compilation Failed.10-04-06 10:40:43 Shutting down server...10-04-06 10:40:43 Shutting down admin server...10-04-06 10:40:43 Shutting down ScriptCore...
const psgpowa = 1; //psg powerconst psgtype = 14; //psg bullet typeconst psgrang = 666; //psg rangeconst psgspee = 50; //psg bullet speedconst maxpsg = 5; //max psgs on map
const psgpowa = 1;psgtype = 14;psgrang = 666;psgspee = 50;maxpsg = 5;
constColor = $0099CC; //Color to be used.psgpowa = 1;psgtype = 14;psgrang = 666;psgspee = 50;maxpsg = 5;var pname: string; money: array[1..32] of integer; statcost:integer; giveid:integer; psgcost:integer; give,ammount,player:string; sgx,sgy:array[1..maxpsg] of single; sga,sgo,sgt:array[1..maxpsg] of byte; sgd:array[1..maxpsg] of boolean;procedure ActivateServer(); begin statcost := 30; psgcost := 35; end;procedure OnJoinGame(ID, Team: byte); begin money[ID] := 1; writeConsole(ID, 'Your Money is: $' + inttostr(money[ID]),Color); writeConsole(ID, 'Do /shop to see the shop, do /money to see your money !' + inttostr(money[ID]), Color); end;procedure OnPlayerKill(Killer, Victim: byte;Weapon: string); begin if Killer = Victim then begin writeConsole(Killer, 'you cant kill yourself for money !', Color); end else begin money[Killer] := money[Killer]+1; writeConsole(Killer, 'You just got $1 your money is now: $' + inttostr(money[Killer]), Color); end; end;function OnPlayerCommand(ID: Byte; Text: string): boolean; begin give := GetPiece(LowerCase(Text), ' ', 0); ammount := GetPiece(LowerCase(Text), ' ', 1); player := GetPiece(Text, ' ', 2); if give = '/give' then begin if money[ID] > strtoint(ammount) then begin giveid := NameToID(player); if giveid > 0 then begin money[ID] := money[ID] - strtoint(ammount); money[giveid] := money[giveid] + strtoint(ammount); writeconsole(ID, 'You gave $' + ammount + ' to: ' + IDToName(giveid) + ', Your money is now: $' + inttostr(money[ID]) , Color); writeconsole(giveid, 'You recived $' + ammount + ' from: ' + IDToName(ID) + ', Your money is now: $' + inttostr(money[giveid]), Color); end else begin writeconsole(ID, 'That person does not exist.', Color); end; end else begin writeconsole(ID, 'You don''t have enough money', Color); end; end; if regExpMatch('^/(money|moneys)$', Text) then begin writeConsole(ID, 'Your money is: $' + inttostr(money[ID]), Color); end; if regExpMatch('^/(commands|shop|spawn|help)$', Text) then begin writeConsole(ID, '#############SHOP####################', Color); writeConsole(ID, '#commands: #', Color); writeConsole(ID, '#/stat-Turret $30(spawn a turret) #', Color); writeConsole(ID, '#/psg $35(Spawn a sentry gun) #', Color); writeConsole(ID, '#More will come :P #', Color); writeConsole(ID, '#############END#####################', Color); end;if regExpMatch('^/(stationary|stat|turrent)$', Text) then begin if money[ID] >= statcost then begin money[ID] := money[ID] - statcost; SpawnObject(GetPlayerStat(ID,'x')+20,GetPlayerStat(ID,'y')-20,15); writeconsole(ID, 'You bought a Stat Gun for $30, you have $' + inttostr(money[ID]), Color); end else begin writeconsole(ID, 'You do not have enough money', Color); end; end;end;if regExpMatch('^/(psg)$', Text) then begin if money[ID] >= psgcost then begin money[ID] := money[ID] - psgcost; Command('/addbot1 mercenary') writeconsole(ID, 'You bought a Sentry Gun for $35, you have $' + inttostr(money[ID]), Color); end else begin writeconsole(ID, 'You do not have enough money', Color); end; end;procedure OnMapChange(newmap:string);var n:byte;beginfor n:=1 to maxpsg do begin sgd[n]:=false; end; end;procedure OnLeaveGame(ID,team:byte;kicked:boolean);var n:byte;beginfor n:=1 to maxpsg do begin if sgo[n]=ID then sgd[n]:=false; end;end;procedure apponidle(ticks:integer);var n,k:byte; var x,y,dista:single;beginfor n:=1 to maxpsg do beginif sgd[n]=true then beginCreateBullet(sgx[n],sgy[n],0,0,0,5,sgo[n]);for k:=1 to 32 do begingetplayerxy(k,x,y);if (getplayerstat(k,'team')<>sgt[n]) and (getplayerstat(k,'alive')=true) and (raycast(sgx[n],sgy[n],x,y,dista,psgrang)=true) and (dista<=psgrang) then beginx:=((x-sgx[n]) / dista)*psgspee; y:=((y-sgy[n]) / dista)*psgspee;CreateBullet(sgx[n],sgy[n],x,y,psgpowa,psgtype,sgo[n]); sga[n]:=sga[n]-1;if sga[n]=0 then begin sgd[n]:=false; Writeconsole(sgo[n],'One of your sentry guns ran out of ammo.',$0000FF00); end;break;end;end;end;end;end;procedure placesentry(x,y:single;ID,team:byte);var n,f:byte;beginif getplayerstat(ID,'Ground')=true then beginf:=maxpsg;for n:=1 to maxpsg do beginif sgd[n]=true then f:=f-1;end;if f=0 then DrawText(ID,'Maximum of '+inttostr(maxpsg)+' sentry guns on map reached.',250,RGB(0,255,0),0.10,150,400) else beginfor n:=1 to maxpsg do beginif sgd[n]=false then break;end;sgx[n]:=x; sgy[n]:=y; sgo[n]:=ID; sgt[n]:=team; sga[n]:=psgammo; sgd[n]:=true;DrawText(ID,'Sentry gun placed!',250,RGB(0,255,0),0.1,75,350);end;end else DrawText(ID,'You are in mid-air!',250,RGB(0,255,0),0.10,220,400);end;function OnPlayerCommand(ID:byte;text:string):boolean;begintext:=lowercase(text);if text='/psg' then placesentry(getplayerstat(ID,'x'),getplayerstat(ID,'y'),ID,getplayerstat(ID,'team'));result:=false;end;
10-04-06 13:13:40 Console Log Started10-04-06 13:13:40 Loaded weapons mod "Default mod v1.5"10-04-06 13:13:40 Welcome to Soldat 1.5.010-04-06 13:13:40 [*] ScriptCore v2.6 loaded! Found 3 scripts...10-04-06 13:13:40 [*] Compiling loot -> loot.pas...10-04-06 13:13:40 [*] Compiling rule -> rule.pas...10-04-06 13:13:40 [*] Compiling Weapon_shop -> Weapon_shop.pas...10-04-06 13:13:40 [*] Weapon_shop -> [Hint] (50:10): Variable 'Result' never used10-04-06 13:13:40 [*] Weapon_shop -> [Error] (126:1): 'BEGIN' expected10-04-06 13:13:40 [*] Compilation Failed.10-04-06 13:13:40 Shutting down server...10-04-06 13:13:40 Shutting down admin server...10-04-06 13:13:40 Shutting down ScriptCore...
constColor = $0099CC; //Color to be used.psgpowa = 1;psgtype = 14;psgrang = 666;psgspee = 50;maxpsg = 5;psgammo = 10; //took the liberty to invent it, since it was missing.var pname: string; money: array[1..32] of integer; statcost:integer; giveid:integer; psgcost:integer; give,ammount,player:string; sgx,sgy:array[1..maxpsg] of single; sga,sgo,sgt:array[1..maxpsg] of byte; sgd:array[1..maxpsg] of boolean; procedure placesentry(x,y:single;ID,team:byte);var n,f:byte;beginif getplayerstat(ID,'Ground')=true then beginf:=maxpsg;for n:=1 to maxpsg do beginif sgd[n]=true then f:=f-1;end;if f=0 then DrawText(ID,'Maximum of '+inttostr(maxpsg)+' sentry guns on map reached.',250,RGB(0,255,0),0.10,150,400) else beginfor n:=1 to maxpsg do beginif sgd[n]=false then break;end;sgx[n]:=x; sgy[n]:=y; sgo[n]:=ID; sgt[n]:=team; sga[n]:=psgammo; sgd[n]:=true;DrawText(ID,'Sentry gun placed!',250,RGB(0,255,0),0.1,75,350);end;end else DrawText(ID,'You are in mid-air!',250,RGB(0,255,0),0.10,220,400);end; procedure ActivateServer(); begin statcost := 30; psgcost := 35; end;procedure OnJoinGame(ID, Team: byte); begin money[ID] := 35; writeConsole(ID, 'Your Money is: $' + inttostr(money[ID]),Color); writeConsole(ID, 'Do /shop to see the shop, do /money to see your money !' + inttostr(money[ID]), Color); end;procedure OnPlayerKill(Killer, Victim: byte;Weapon: string); begin if Killer = Victim then begin writeConsole(Killer, 'you cant kill yourself for money !', Color); end else begin money[Killer] := money[Killer]+1; writeConsole(Killer, 'You just got $1 your money is now: $' + inttostr(money[Killer]), Color); end; end;function OnPlayerCommand(ID: Byte; Text: string): boolean; begin give := GetPiece(LowerCase(Text), ' ', 0); ammount := GetPiece(LowerCase(Text), ' ', 1); player := GetPiece(Text, ' ', 2); if give = '/give' then begin if money[ID] > strtoint(ammount) then begin giveid := NameToID(player); if giveid > 0 then begin money[ID] := money[ID] - strtoint(ammount); money[giveid] := money[giveid] + strtoint(ammount); writeconsole(ID, 'You gave $' + ammount + ' to: ' + IDToName(giveid) + ', Your money is now: $' + inttostr(money[ID]) , Color); writeconsole(giveid, 'You recived $' + ammount + ' from: ' + IDToName(ID) + ', Your money is now: $' + inttostr(money[giveid]), Color); end else begin writeconsole(ID, 'That person does not exist.', Color); end; end else begin writeconsole(ID, 'You don''t have enough money', Color); end; end; if regExpMatch('^/(money|moneys)$', Text) then begin writeConsole(ID, 'Your money is: $' + inttostr(money[ID]), Color); end; if regExpMatch('^/(commands|shop|spawn|help)$', Text) then begin writeConsole(ID, '#############SHOP####################', Color); writeConsole(ID, '#commands: #', Color); writeConsole(ID, '#/stat-Turret $30(spawn a turret) #', Color); writeConsole(ID, '#/psg $35(Spawn a sentry gun) #', Color); writeConsole(ID, '#More will come :P #', Color); writeConsole(ID, '#############END#####################', Color); end;if regExpMatch('^/(stationary|stat|turrent)$', Text) then begin if money[ID] >= statcost then begin money[ID] := money[ID] - statcost; SpawnObject(GetPlayerStat(ID,'x')+20,GetPlayerStat(ID,'y')-20,15); writeconsole(ID, 'You bought a Stat Gun for $30, you have $' + inttostr(money[ID]), Color); end else begin writeconsole(ID, 'You do not have enough money', Color); end; end; result := false;if regExpMatch('^/(psg)$', Text) then begin if money[ID] >= psgcost then begin money[ID] := money[ID] - psgcost; placesentry(getplayerstat(ID,'x'),getplayerstat(ID,'y'),ID,getplayerstat(ID,'team')); writeconsole(ID, 'You bought a Sentry Gun for $35, you have $' + inttostr(money[ID]), Color); end else begin writeconsole(ID, 'You do not have enough money', Color); end;end;end;procedure OnMapChange(newmap:string);var n:byte;beginfor n:=1 to maxpsg do begin sgd[n]:=false; end; end;procedure OnLeaveGame(ID,team:byte;kicked:boolean);var n:byte;beginfor n:=1 to maxpsg do begin if sgo[n]=ID then sgd[n]:=false; end;end;procedure apponidle(ticks:integer);var n,k,:byte; x,y,dista:single;beginfor n:=1 to maxpsg do beginif sgd[n]=true then beginCreateBullet(sgx[n],sgy[n],0,0,0,5,sgo[n]);for k:=1 to 32 do begingetplayerxy(k,x,y);if (getplayerstat(k,'team')<>sgt[n]) and (getplayerstat(k,'alive')=true) and (raycast(sgx[n],sgy[n],x,y,dista,psgrang)=true) and (dista<=psgrang) then beginx :=((x-sgx[n]) / dista)*psgspee; y:=((y-sgy[n]) / dista)*psgspee;CreateBullet(sgx[n],sgy[n],x,y,psgpowa,psgtype,sgo[n]); sga[n]:=sga[n]-1;if sga[n]=0 then begin sgd[n]:=false; Writeconsole(sgo[n],'One of your sentry guns ran out of ammo.',$0000FF00); end;break;end;end;end;end;end;
10-04-06 14:07:58 Console Log Started10-04-06 14:07:58 Loaded weapons mod "Default mod v1.5"10-04-06 14:07:58 Welcome to Soldat 1.5.010-04-06 14:07:58 [*] ScriptCore v2.6 loaded! Found 3 scripts...10-04-06 14:07:58 [*] Compiling loot -> loot.pas...10-04-06 14:07:58 [*] Compiling rule -> rule.pas...10-04-06 14:07:58 [*] Compiling Weapon_shop -> Weapon_shop.pas...10-04-06 14:07:58 [*] Weapon_shop -> [Error] (175:9): Identifier expected10-04-06 14:07:58 [*] Weapon_shop -> [Error] (175:10): colon (':') expected10-04-06 14:07:58 [*] Compilation Failed.10-04-06 14:07:58 Shutting down server...10-04-06 14:07:58 Shutting down admin server...10-04-06 14:07:58 Shutting down ScriptCore...
Procedure AppOnIdle(Ticks: Integer); Var N, K: Byte; X, Y, Dista: Single; Begin For N := 1 To maxpsg Do Begin if sgd[n] = True Then Begin CreateBullet(sgx[n],sgy[n],0,0,0,5,sgo[n]); For K := 1 To 32 Do Begin GetPlayerXy(K,X,Y); if GetPlayerStat(K,'Team') <> sgt[n] Then if GetPlayerStat(K,'Alive') = True Then if RayCast(sgx[n],sgy[n],x,y,dista,psgrang) = True Then if dista <= psgrang Then Begin x := ((x-sgx[n]) / dista)*psgspee; y := ((y-sgy[n]) / dista)*psgspee; CreateBullet(sgx[n],sgy[n],x,y,psgpowa,psgtype,sgo[n]); sga[n]:=sga[n]-1; if sga[n] = 0 Then Begin sgd[n] := false; Writeconsole(sgo[n],'One of your sentry guns ran out of ammo.',$0000FF00); end; Break; end; end; end; end;end;