0 Members and 1 Guest are viewing this topic.
// 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 = 10; //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;
Can't you just spawn a stat gun and then spawn a dummy bot on it?It is so much easier, I think avarax used it in either hexer or miricale mod.
You could always spawn a normal bot, until it stays on the turret. Then it would only move if it sees a flag.