Official Soldat Forums
Server Talk => Scripting Discussions and Help => Topic started by: frosty on April 04, 2010, 11:55:06 pm
-
i have a big problem, this is urgent, i cant get my server running until this is fixed
the code:var
Cash:Integer;
i,BonusID,ID,HC,EBN,ED,EBNM,EDM,DED:Byte;
Command:String;
deathexp: Boolean;
procedure Nova(const X,Y,speed,decentralize,power: single; ID,style: byte; n: integer);
var i: integer;
angle: single;
begin
angle := 2*pi/n;
for i:=0 to n do
CreateBullet(X+cos(angle*i)*decentralize, Y+sin(angle*i)*decentralize, cos(angle*i)*speed, sin(angle*i)*speed, power,style , ID );
end;
procedure ActivateServer();
begin
Cash:=0;
EBN:=3;
EBNM:=1;
EDM:=1;
BonusID:=4;
DED:=25;
end;
procedure OnPlayerKill(Killer, Victim: byte; Weapon: string);
begin
if deathexp = true then begin
{for i := 1 to 5 do}
CreateBullet(GetPlayerStat(Victim, 'X'), GetPlayerStat(Victim, 'Y') - 0, 0, 0,100, 4, Killer);
Nova(GetPlayerstat(Victim,'X'),Getplayerstat(Victim,'Y'),0,ED,0, Killer,4,EBN);
Givebonus(Killer,BonusID)
Cash :=Cash+1;
//WriteLn('Cash Updated');
//WriteConsole(0,'Global Player Cash: '+inttostr(Cash),$EE81FAA1);
//WriteLn('Cash Displayed');
end;
function OnPlayerCommand(ID: Byte; Text: string): boolean;
begin
if Text = '/cash' then begin
WriteConsole(0,IdtoName(ID)+' has just requested Cash levels!',$EE81FAA1);
WriteConsole(0,'Global Player Cash: '+inttostr(Cash),$EE81FAA1);
end;
if Text = '/buy pred' then begin
if Cash < 50 then begin
WriteConsole(0,IdtoName(ID)+' just tried to purchase predator, not enough funds!',$EE81FAA1);
end;
if Cash >= 50 then begin
Cash :=Cash-50;
WriteConsole(0,IdtoName(ID)+' has just bought predator for 50 Cash',$EE81FAA1);
end;
end;
if Text = '/buy bes' then begin
if Cash < 65 then begin
WriteConsole(0,IdtoName(ID)+' just tried to purchase berserker, not enough funds!',$EE81FAA1);
end;
if Cash >= 65 then begin
Cash :=Cash-65;
WriteConsole(0,IdtoName(ID)+' has just bought berserker for 65 Cash',$EE81FAA1);
GiveBonus(ID, 2);
end;
end;
if Text = '/buy clusters' then begin
if Cash < 1000 then begin
If BonusID <> 5 then begin
WriteConsole(0,IdtoName(ID)+' just tried to purchase the clusters, not enough funds!',$EE81FAA1);
end;
end;
if BonusID = 5 then begin
WriteConsole(ID,'cluster grenades are already in affect, try normal nades!',$EE81FAA1);
end;
if Cash >= 1000 then begin
If BonusID <> 5 then begin
Cash :=Cash-1000;
BonusID:=5;
WriteConsole(0,IdtoName(ID)+' has just bought the cluster grenade upgrade for 1000 Cash',$EE81FAA1);
GiveBonus(ID,BonusID);
end;
end;
end;
if Text = '/buy nades' then begin
if Cash < 1000 then begin
If BonusID <> 4 then begin
WriteConsole(0,IdtoName(ID)+' just tried to purchase the nades, not enough funds!',$EE81FAA1);
end;
end;
if BonusID = 4 then begin
WriteConsole(ID,'regular grenades are already in affect, try clusters!',$EE81FAA1);
end;
if Cash >= 1000 then begin
If BonusID <> 4 then begin
Cash :=Cash-1000;
BonusID:=4;
WriteConsole(0,IdtoName(ID)+' has just bought the regular grenade upgrade for 1000 Cash',$EE81FAA1);
GiveBonus(ID,BonusID);
end;
end;
end;
//if Text = '/buy dex' then begin
//if Cash < 3000 then begin
//WriteConsole(0,IdtoName(ID)+' just tried to purchase bigger bangs, not enough //funds!',$EE81FAA1);
//end;
//if Cash >= 3000 then begin
//EBNM :=EBNM+1:
//EBN :=3*EBNM;
//EDM :=EDM+1;
//ED := (5*EDM)+ED;
//Cash :=Cash-3000;
//WriteConsole(0,IdtoName(ID)+' has just bought bigger bangs for 3000 //Cash',$EE81FAA1);
//end;
//end;
//if Text = '/buy holycross' then begin
//if Cash < 1000 then begin
//WriteConsole(0,IdtoName(ID)+' just tried to purchase Holy Cross, not enough //funds!',$EE81FAA1);
//end;
//if Cash >= 1000 then begin
//HC:=1;
//WriteConsole(0,IdtoName(ID)+' has just bought Holy Cross for 1000 Cash',$EE81FAA1);
//end;
//end;
if Text = '/items' then begin
WriteConsole(0,'/buy pred - gives u pred bonus - 50 cash',$EE81FAA1);
WriteConsole(0,'/buy bes - gives u berserker bonus - 65 cash',$EE81FAA1);
WriteConsole(0,'/buy clusters - upgrades your nade bonus to clusters - 1000 cash',$EE81FAA1);
WriteConsole(0,'/buy nades - upgrades your cluster bonus to nades - 1000 cash',$EE81FAA1);
WriteConsole(0,'---->grenade upgrades affects whole team',$EE81FAA1);
//WriteConsole(0,'/buy holycross - Kills all zombies in Red Team Base on Red Team score //- 1000 cash',$EE81FAA1);
end;
end;
procedure OnMapChange(NewMap: string);
begin
deathexp := true;
For i := 0 to Numplayers do
begin
GiveBonus(i,BonusID);
end;
end;
procedure OnPlayerRespawn(ID: byte);
begin
GiveBonus(ID, BonusID);
end;
//procedure OnJoinTeam(ID, Team: byte);
//begin
//GiveBonus(ID, BonusID);
//end;
//procedure OnFlagScore(ID, TeamFlag: byte);
//begin
//if HC = 1 then begin
//
//end;
//end;
function OnCommand(ID: Byte; Text: string): boolean;
begin
if GetPiece(text,' ',0) = '/raisecash' then begin
Cash := Cash + Strtoint(GetPiece(Text,' ',1));
WriteConsole(0,'Admin has just deposited '+Getpiece(Text,' ',1)+' Global Player Cash!',$EE81FAA1);
end;
if Text = '/deathexplode' then begin
WriteConsole(0,'death explosions enabled', $00EE0000);
WriteLn('death explosions have been enabled by ' + IntToStr(ID) + '!');
deathexp := True;
end;
if Text = '/nodeathexp' then begin
WriteConsole(0,'death explosions disabled', $00EE0000);
WriteLn('death explosions have been disabled by ' + IntToStr(ID) + '!');
deathexp := False;
end;
end;
the error:
[21:1]Unknown identifier 'Nova''
why is that coming up when i have defined Nova the same way as this script which is compiling fine: var
flak,rd,bb: Boolean;
Timer,i,ObjectID:integer;
Cash:byte;
deathexp: Boolean;
procedure Nova(const X,Y,speed,decentralize,power: single; ID,style: byte; n: integer);
var i: integer;
angle: single;
begin
angle := 2*pi/n;
for i:=0 to n do
CreateBullet(X+cos(angle*i)*decentralize, Y+sin(angle*i)*decentralize, cos(angle*i)*speed, sin(angle*i)*speed, power,style , ID );
end;
procedure ActivateServer();
begin
Cash:=0;
end;
function OnCommand(ID: Byte; Text: string): Boolean;
var
destroy:Byte;
begin
if Text = '/flakb' then begin
WriteLn('The flak event has been initiated by ' + IntToStr(ID) + '!');
WriteConsole(0,'The Flak shells event is beginning!',$00EE00EE);
flak:= True;
end;
if Text = '/flak end' then begin
WriteLn('The flak event has been cancelled by ' + IntToStr(ID) + '!');
WriteConsole(0, 'The Flak shells event has finished!', $00EE00EE);
WriteConsole(0, 'server administration hopes that you enjoyed the event!', $EEEE00EE);
flak:= False;
end;
if Text = '/killall' then begin
for destroy := 1 to 32 do
DoDamage(destroy,99999999)
WriteConsole(0, 'ALL GO BOOM!', $00EE00EE);
end;
if Text = '/rdeath' then begin
rd := True;
WriteConsole(0,'Wacky deaths enabled', $00EE0000);
end;
if Text = '/nrdeath' then begin
rd := False;
WriteConsole(0,'Wacky deaths disabled', $00EE0000);
end;
if Text = '/bb1' then begin
bb := True;
end;
if Text = '/bb0' then begin
bb := False;
end;
end;
function OnPlayerDamage(Victim, Shooter: Byte; Damage: Integer): Integer;
begin
result := Damage;
{DoDamage(Victim,9999999);}
if flak = True then begin
CreateBullet(GetPlayerStat(Victim, 'X'), GetPlayerStat(Victim, 'Y') - 0, 0, 0,100, 10, Shooter);
end;
end;
procedure OnPlayerKill(Killer, Victim: byte;Weapon: string);
var
i,i2,i3,i4:Byte;
begin
if rd = true then begin
for i := 1 to NumPlayers do
CreateBullet(GetPlayerStat(i,'x'), GetPlayerStat(i,'y') - 0, 0, 0,100, 10, Killer);
end;
if GetPlayerStat(Killer, 'Name') = 'MR.ZOMBIE' then begin
if Killer = Victim then begin
end else begin
WriteConsole(0,IDtoName(Victim) + ' Just had his head sawed off', $00EE00EE);
end;
end;
if Victim = Killer then begin //begin nova
// This message will only happen for selfkilling bots, though.
WriteConsole(0, IDtoName(Victim) + ' just annihilated himself', $00EE0000);
Nova(GetPlayerstat(Killer,'X'),Getplayerstat(Killer,'Y'),20,15,0, Killer,9,75);
end;
if bb = True then begin
CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y') - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x')+25, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y')+25 - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x')-25, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y')-25 - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x')+50, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y')+50 - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x')-50, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y')-50 - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x')+75, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y')+75 - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x')-75, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y')-75 - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x')+100, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y')+100 - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x')-100, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y')-100 - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x')+125, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y')+125 - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x')-125, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y')-125 - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x')+150, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y')+150 - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x')-150, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y')-150 - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x')+175, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y')+175 - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x')-175, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y')-175 - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x')+200, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y')+200 - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x')-200, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y')-200 - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x')+225, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y')+225 - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x')-225, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y')-225 - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x')+250, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y')+250 - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x')-250, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y')-250 - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x')+275, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y')+275 - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x')-275, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y')-275 - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x')+300, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y')+300 - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x')-300, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y')-300 - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x')+325, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y')+325 - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x')-325, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y')-325 - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x')+350, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y')+350 - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x')-350, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y')-350 - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x')+375, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y')+375 - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x')-375, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y')-375 - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x')+400, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y')+400 - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x')-400, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y')-400 - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x')+425, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y')+425 - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x')-425, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y')-425 - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x')+450, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y')+450 - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x')-450, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y')-450 - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x')+475, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y')+475 - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x')-475, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y')-475 - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x')+500, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y')+500 - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x')-500, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y')-500 - 0, 0, 0,100, 10, Killer);
//begin extended side
CreateBullet(GetPlayerStat(Victim,'x')+525, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x')-525, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x')+550, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x')-550, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x')+575, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x')-575, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x')+600, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x')-600, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x')+625, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x')-625, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x')+650, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x')-650, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x')+675, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x')-675, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x')+700, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x')-700, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x')+725, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x')-725, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x')+750, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x')-750, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x')+775, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x')-775, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x')+800, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x')-800, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x')+825, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x')-825, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x')+850, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x')-850, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x')+875, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x')-875, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x')+900, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x')-900, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x')+925, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x')-925, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x')+950, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x')-950, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x')+975, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x')-975, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x')+1000, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x')-1000, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x')+1025, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x')-1025, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x')+1050, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x')-1050, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 10, Killer);
//begin extended top/bottom
CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y')+525 - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y')-525 - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y')+550 - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y')-550 - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y')+575 - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y')-575 - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y')+600 - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y')-600 - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y')+625 - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y')-625 - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y')+650 - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y')-650 - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y')+675 - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y')-675 - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y')+700 - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y')-700 - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y')+725 - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y')-725 - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y')+750 - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y')-750 - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y')+775 - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y')-775 - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y')+800 - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y')-800 - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y')+825 - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y')-825 - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y')+850 - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y')-850 - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y')+875 - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y')-875 - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y')+900 - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y')-900 - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y')+925 - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y')-925 - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y')+950 - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y')-950 - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y')+975 - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y')-975 - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y')+1000 - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y')-1000 - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y')+1025 - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y')-1025 - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y')+1050 - 0, 0, 0,100, 10, Killer);
CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y')-1050 - 0, 0, 0,100, 10, Killer);
end;
end;
procedure AppOnIdle(Ticks: integer);
begin
if Timer > 0 then
Timer := Timer - 1;
if Timer = 0 then begin
KillObject(ObjectID);
Timer := -1;
end;
end;
function BigBangDeath(Victim:Byte; Killer:Byte): Byte;
begin
CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y') - 0, 0, 0,100, 9, Killer);
CreateBullet(GetPlayerStat(Victim,'x')+25, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 9, Killer);
CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y')+25 - 0, 0, 0,100, 9, Killer);
CreateBullet(GetPlayerStat(Victim,'x')-25, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 9, Killer);
CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y')-25 - 0, 0, 0,100, 9, Killer);
CreateBullet(GetPlayerStat(Victim,'x')+50, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 9, Killer);
CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y')+50 - 0, 0, 0,100, 9, Killer);
CreateBullet(GetPlayerStat(Victim,'x')-50, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 9, Killer);
CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y')-50 - 0, 0, 0,100, 9, Killer);
CreateBullet(GetPlayerStat(Victim,'x')+75, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 9, Killer);
CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y')+75 - 0, 0, 0,100, 9, Killer);
CreateBullet(GetPlayerStat(Victim,'x')-75, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 9, Killer);
CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y')-75 - 0, 0, 0,100, 9, Killer);
CreateBullet(GetPlayerStat(Victim,'x')+100, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 9, Killer);
CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y')+100 - 0, 0, 0,100, 9, Killer);
CreateBullet(GetPlayerStat(Victim,'x')-100, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 9, Killer);
CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y')-100 - 0, 0, 0,100, 9, Killer);
CreateBullet(GetPlayerStat(Victim,'x')+125, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 9, Killer);
CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y')+125 - 0, 0, 0,100, 9, Killer);
CreateBullet(GetPlayerStat(Victim,'x')-125, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 9, Killer);
CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y')-125 - 0, 0, 0,100, 9, Killer);
CreateBullet(GetPlayerStat(Victim,'x')+150, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 9, Killer);
CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y')+150 - 0, 0, 0,100, 9, Killer);
CreateBullet(GetPlayerStat(Victim,'x')-150, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 9, Killer);
CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y')-150 - 0, 0, 0,100, 9, Killer);
CreateBullet(GetPlayerStat(Victim,'x')+175, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 9, Killer);
CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y')+175 - 0, 0, 0,100, 9, Killer);
CreateBullet(GetPlayerStat(Victim,'x')-175, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 9, Killer);
CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y')-175 - 0, 0, 0,100, 9, Killer);
CreateBullet(GetPlayerStat(Victim,'x')+200, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 9, Killer);
CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y')+200 - 0, 0, 0,100, 9, Killer);
CreateBullet(GetPlayerStat(Victim,'x')-200, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 9, Killer);
CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y')-200 - 0, 0, 0,100, 9, Killer);
CreateBullet(GetPlayerStat(Victim,'x')+225, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 9, Killer);
CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y')+225 - 0, 0, 0,100, 9, Killer);
CreateBullet(GetPlayerStat(Victim,'x')-225, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 9, Killer);
CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y')-225 - 0, 0, 0,100, 9, Killer);
CreateBullet(GetPlayerStat(Victim,'x')+250, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 9, Killer);
CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y')+250 - 0, 0, 0,100, 9, Killer);
CreateBullet(GetPlayerStat(Victim,'x')-250, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 9, Killer);
CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y')-250 - 0, 0, 0,100, 9, Killer);
CreateBullet(GetPlayerStat(Victim,'x')+275, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 9, Killer);
CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y')+275 - 0, 0, 0,100, 9, Killer);
CreateBullet(GetPlayerStat(Victim,'x')-275, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 9, Killer);
CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y')-275 - 0, 0, 0,100, 9, Killer);
CreateBullet(GetPlayerStat(Victim,'x')+300, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 9, Killer);
CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y')+300 - 0, 0, 0,100, 9, Killer);
CreateBullet(GetPlayerStat(Victim,'x')-300, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 9, Killer);
CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y')-300 - 0, 0, 0,100, 9, Killer);
CreateBullet(GetPlayerStat(Victim,'x')+325, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 9, Killer);
CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y')+325 - 0, 0, 0,100, 9, Killer);
CreateBullet(GetPlayerStat(Victim,'x')-325, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 9, Killer);
CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y')-325 - 0, 0, 0,100, 9, Killer);
CreateBullet(GetPlayerStat(Victim,'x')+350, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 9, Killer);
CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y')+350 - 0, 0, 0,100, 9, Killer);
CreateBullet(GetPlayerStat(Victim,'x')-350, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 9, Killer);
CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y')-350 - 0, 0, 0,100, 9, Killer);
CreateBullet(GetPlayerStat(Victim,'x')+375, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 9, Killer);
CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y')+375 - 0, 0, 0,100, 9, Killer);
CreateBullet(GetPlayerStat(Victim,'x')-375, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 9, Killer);
CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y')-375 - 0, 0, 0,100, 9, Killer);
CreateBullet(GetPlayerStat(Victim,'x')+400, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 9, Killer);
CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y')+400 - 0, 0, 0,100, 9, Killer);
CreateBullet(GetPlayerStat(Victim,'x')-400, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 9, Killer);
CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y')-400 - 0, 0, 0,100, 9, Killer);
CreateBullet(GetPlayerStat(Victim,'x')+425, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 9, Killer);
CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y')+425 - 0, 0, 0,100, 9, Killer);
CreateBullet(GetPlayerStat(Victim,'x')-425, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 9, Killer);
CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y')-425 - 0, 0, 0,100, 9, Killer);
CreateBullet(GetPlayerStat(Victim,'x')+450, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 9, Killer);
CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y')+450 - 0, 0, 0,100, 9, Killer);
CreateBullet(GetPlayerStat(Victim,'x')-450, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 9, Killer);
CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y')-450 - 0, 0, 0,100, 9, Killer);
CreateBullet(GetPlayerStat(Victim,'x')+475, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 9, Killer);
CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y')+475 - 0, 0, 0,100, 9, Killer);
CreateBullet(GetPlayerStat(Victim,'x')-475, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 9, Killer);
CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y')-475 - 0, 0, 0,100, 9, Killer);
CreateBullet(GetPlayerStat(Victim,'x')+500, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 9, Killer);
CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y')+500 - 0, 0, 0,100, 9, Killer);
CreateBullet(GetPlayerStat(Victim,'x')-500, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 9, Killer);
CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y')-500 - 0, 0, 0,100, 9, Killer);
//begin extended side
CreateBullet(GetPlayerStat(Victim,'x')+525, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 9, Killer);
CreateBullet(GetPlayerStat(Victim,'x')-525, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 9, Killer);
CreateBullet(GetPlayerStat(Victim,'x')+550, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 9, Killer);
CreateBullet(GetPlayerStat(Victim,'x')-550, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 9, Killer);
CreateBullet(GetPlayerStat(Victim,'x')+575, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 9, Killer);
CreateBullet(GetPlayerStat(Victim,'x')-575, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 9, Killer);
CreateBullet(GetPlayerStat(Victim,'x')+600, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 9, Killer);
CreateBullet(GetPlayerStat(Victim,'x')-600, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 9, Killer);
CreateBullet(GetPlayerStat(Victim,'x')+625, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 9, Killer);
CreateBullet(GetPlayerStat(Victim,'x')-625, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 9, Killer);
CreateBullet(GetPlayerStat(Victim,'x')+650, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 9, Killer);
CreateBullet(GetPlayerStat(Victim,'x')-650, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 9, Killer);
CreateBullet(GetPlayerStat(Victim,'x')+675, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 9, Killer);
CreateBullet(GetPlayerStat(Victim,'x')-675, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 9, Killer);
CreateBullet(GetPlayerStat(Victim,'x')+700, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 9, Killer);
CreateBullet(GetPlayerStat(Victim,'x')-700, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 9, Killer);
CreateBullet(GetPlayerStat(Victim,'x')+725, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 9, Killer);
CreateBullet(GetPlayerStat(Victim,'x')-725, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 9, Killer);
CreateBullet(GetPlayerStat(Victim,'x')+750, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 9, Killer);
CreateBullet(GetPlayerStat(Victim,'x')-750, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 9, Killer);
CreateBullet(GetPlayerStat(Victim,'x')+775, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 9, Killer);
CreateBullet(GetPlayerStat(Victim,'x')-775, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 9, Killer);
CreateBullet(GetPlayerStat(Victim,'x')+800, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 9, Killer);
CreateBullet(GetPlayerStat(Victim,'x')-800, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 9, Killer);
CreateBullet(GetPlayerStat(Victim,'x')+825, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 9, Killer);
CreateBullet(GetPlayerStat(Victim,'x')-825, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 9, Killer);
CreateBullet(GetPlayerStat(Victim,'x')+850, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 9, Killer);
CreateBullet(GetPlayerStat(Victim,'x')-850, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 9, Killer);
CreateBullet(GetPlayerStat(Victim,'x')+875, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 9, Killer);
CreateBullet(GetPlayerStat(Victim,'x')-875, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 9, Killer);
CreateBullet(GetPlayerStat(Victim,'x')+900, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 9, Killer);
CreateBullet(GetPlayerStat(Victim,'x')-900, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 9, Killer);
CreateBullet(GetPlayerStat(Victim,'x')+925, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 9, Killer);
CreateBullet(GetPlayerStat(Victim,'x')-925, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 9, Killer);
CreateBullet(GetPlayerStat(Victim,'x')+950, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 9, Killer);
CreateBullet(GetPlayerStat(Victim,'x')-950, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 9, Killer);
CreateBullet(GetPlayerStat(Victim,'x')+975, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 9, Killer);
CreateBullet(GetPlayerStat(Victim,'x')-975, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 9, Killer);
CreateBullet(GetPlayerStat(Victim,'x')+1000, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 9, Killer);
CreateBullet(GetPlayerStat(Victim,'x')-1000, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 9, Killer);
CreateBullet(GetPlayerStat(Victim,'x')+1025, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 9, Killer);
CreateBullet(GetPlayerStat(Victim,'x')-1025, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 9, Killer);
CreateBullet(GetPlayerStat(Victim,'x')+1050, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 9, Killer);
CreateBullet(GetPlayerStat(Victim,'x')-1050, GetPlayerStat(Victim,'y') - 0, 0, 0,100, 9, Killer);
end;
-
Didnt read through your code but sounds like you dont have the nova() function above wherever your trying to se it.
PS:
look up for loops.
-
nvm i seemed to have a duplicate procedure
now im getting identifier expected on line 111
var
Cash:Integer;
i,BonusID,ID,HC,EBN,ED,EBNM,EDM,DED:Byte;
Command:String;
deathexp: Boolean;
procedure Nova(const X,Y,speed,decentralize,power: single; ID,style: byte; n: integer);
var i: integer;
angle: single;
begin
angle := 2*pi/n;
for i:=0 to n do
CreateBullet(X+cos(angle*i)*decentralize, Y+sin(angle*i)*decentralize, cos(angle*i)*speed, sin(angle*i)*speed, power,style , ID );
end;
procedure ActivateServer();
begin
Cash:=0;
EBN:=3;
EBNM:=1;
EDM:=1;
BonusID:=4;
DED:=25;
end;
procedure OnPlayerKill(Killer, Victim: byte; Weapon: string);
begin
if deathexp = true then begin
{for i := 1 to 5 do}
CreateBullet(GetPlayerStat(Victim, 'X'), GetPlayerStat(Victim, 'Y') - 0, 0, 0,100, 4, Killer);
Nova(GetPlayerstat(Victim,'X'),Getplayerstat(Victim,'Y'),0,ED,0, Killer,4,EBN);
Givebonus(Killer,BonusID)
Cash :=Cash+1;
//WriteLn('Cash Updated');
//WriteConsole(0,'Global Player Cash: '+inttostr(Cash),$EE81FAA1);
//WriteLn('Cash Displayed');
end;
if Victim = Killer then begin //begin nova
// This message will only happen for selfkilling bots, though.
WriteConsole(0, IDtoName(Victim) + ' just annihilated himself', $00EE0000);
Nova(GetPlayerstat(Killer,'X'),Getplayerstat(Killer,'Y'),20,15,0, Killer,9,75);
end;
end;
function OnPlayerCommand(ID: Byte; Text: string): boolean;
begin
if Text = '/cash' then begin
WriteConsole(0,IdtoName(ID)+' has just requested Cash levels!',$EE81FAA1);
WriteConsole(0,'Global Player Cash: '+inttostr(Cash),$EE81FAA1);
end;
if Text = '/buy pred' then begin
if Cash < 50 then begin
WriteConsole(0,IdtoName(ID)+' just tried to purchase predator, not enough funds!',$EE81FAA1);
end;
if Cash >= 50 then begin
Cash :=Cash-50;
WriteConsole(0,IdtoName(ID)+' has just bought predator for 50 Cash',$EE81FAA1);
end;
end;
if Text = '/buy bes' then begin
if Cash < 65 then begin
WriteConsole(0,IdtoName(ID)+' just tried to purchase berserker, not enough funds!',$EE81FAA1);
end;
if Cash >= 65 then begin
Cash :=Cash-65;
WriteConsole(0,IdtoName(ID)+' has just bought berserker for 65 Cash',$EE81FAA1);
GiveBonus(ID, 2);
end;
end;
if Text = '/buy clusters' then begin
if Cash < 1000 then begin
If BonusID <> 5 then begin
WriteConsole(0,IdtoName(ID)+' just tried to purchase the clusters, not enough funds!',$EE81FAA1);
end;
end;
if BonusID = 5 then begin
WriteConsole(ID,'cluster grenades are already in affect, try normal nades!',$EE81FAA1);
end;
if Cash >= 1000 then begin
If BonusID <> 5 then begin
Cash :=Cash-1000;
BonusID:=5;
WriteConsole(0,IdtoName(ID)+' has just bought the cluster grenade upgrade for 1000 Cash',$EE81FAA1);
GiveBonus(ID,BonusID);
end;
end;
end;
if Text = '/buy nades' then begin
if Cash < 1000 then begin
If BonusID <> 4 then begin
WriteConsole(0,IdtoName(ID)+' just tried to purchase the nades, not enough funds!',$EE81FAA1);
end;
end;
if BonusID = 4 then begin
WriteConsole(ID,'regular grenades are already in affect, try clusters!',$EE81FAA1);
end;
if Cash >= 1000 then begin
If BonusID <> 4 then begin
Cash :=Cash-1000;
BonusID:=4;
WriteConsole(0,IdtoName(ID)+' has just bought the regular grenade upgrade for 1000 Cash',$EE81FAA1);
GiveBonus(ID,BonusID);
end;
end;
end;
if Text = '/buy dex' then begin
if Cash < 3000 then begin
WriteConsole(0,IdtoName(ID)+' just tried to purchase bigger bangs, not enough funds!',$EE81FAA1);
end;
if Cash >= 3000 then begin
EBNM :=EBNM+1:
EBN :=3*EBNM;
EDM :=EDM+1;
ED := (5*EDM)+ED;
Cash :=Cash-3000;
WriteConsole(0,IdtoName(ID)+' has just bought bigger bangs for 3000 Cash',$EE81FAA1);
end;
end;
//if Text = '/buy holycross' then begin
//if Cash < 1000 then begin
//WriteConsole(0,IdtoName(ID)+' just tried to purchase Holy Cross, not enough //funds!',$EE81FAA1);
//end;
//if Cash >= 1000 then begin
//HC:=1;
//WriteConsole(0,IdtoName(ID)+' has just bought Holy Cross for 1000 Cash',$EE81FAA1);
//end;
//end;
if Text = '/items' then begin
WriteConsole(0,'/buy pred - gives u pred bonus - 50 cash',$EE81FAA1);
WriteConsole(0,'/buy bes - gives u berserker bonus - 65 cash',$EE81FAA1);
WriteConsole(0,'/buy clusters - upgrades your nade bonus to clusters - 1000 cash',$EE81FAA1);
WriteConsole(0,'/buy nades - upgrades your cluster bonus to nades - 1000 cash',$EE81FAA1);
WriteConsole(0,'---->grenade upgrades affects whole team',$EE81FAA1);
//WriteConsole(0,'/buy holycross - Kills all zombies in Red Team Base on Red Team score //- 1000 cash',$EE81FAA1);
end;
end;
procedure OnMapChange(NewMap: string);
begin
deathexp := true;
For i := 0 to Numplayers do
begin
GiveBonus(i,BonusID);
end;
end;
procedure OnPlayerRespawn(ID: byte);
begin
GiveBonus(ID, BonusID);
end;
//procedure OnJoinTeam(ID, Team: byte);
//begin
//GiveBonus(ID, BonusID);
//end;
//procedure OnFlagScore(ID, TeamFlag: byte);
//begin
//if HC = 1 then begin
//
//end;
//end;
function OnCommand(ID: Byte; Text: string): boolean;
begin
if GetPiece(text,' ',0) = '/raisecash' then begin
Cash := Cash + Strtoint(GetPiece(Text,' ',1));
WriteConsole(0,'Admin has just deposited '+Getpiece(Text,' ',1)+' Global Player Cash!',$EE81FAA1);
end;
if Text = '/deathexplode' then begin
WriteConsole(0,'death explosions enabled', $00EE0000);
WriteLn('death explosions have been enabled by ' + IntToStr(ID) + '!');
deathexp := True;
end;
if Text = '/nodeathexp' then begin
WriteConsole(0,'death explosions disabled', $00EE0000);
WriteLn('death explosions have been disabled by ' + IntToStr(ID) + '!');
deathexp := False;
end;
end;
From: April 05, 2010, 12:25:43 am
theres no loops, can u please go over it? i cant see where the problem is
the only loop there is is where it gives the bonus to everyone on map change, but, that was working perfect yesterday so it cant be that
From: April 05, 2010, 12:28:42 am
btw hacktank on both scripts above the nova function is just below the vars
From: April 05, 2010, 01:13:48 am
if i comment the code for '/buy dex' it compiles
wtf is wrong with the code for it
if Text = '/buy dex' then begin
if Cash < 3000 then begin
WriteConsole(0,IdtoName(ID)+' just tried to purchase bigger bangs, not enough //funds!',$EE81FAA1);
end;
if Cash >= 3000 then begin
EBNM :=EBMN+1:
EBN :=3*EBNM;
EDM :=EDM+1;
ED := (5*EDM)+ED;
Cash :=Cash-3000;
WriteConsole(0,IdtoName(ID)+' has just bought bigger bangs for 3000 Cash',$EE81FAA1);
end;
end;
From: April 05, 2010, 01:55:52 am
also im having a problem with the script, Givebonus isnt giving the normal grenades
From: April 05, 2010, 01:56:12 am
its only giving clusters
please help!!!!!!
-
INDENT YOUR CODE (http://en.wikipedia.org/wiki/Indent_style)
And you will find missing/extra ENDs and BEGINs more easily
-
Loop example:
procedure OnPlayerKill(Killer, Victim: byte; Weapon: string);
begin
if GetPlayerStat(Killer,'Team') = GetPlayerStat(Victim,'Team') then repeat
WriteConsole(Killer,'NOOB TEAMKILLER!!!1111',$00FF00);
until false;
end;
-
ok here is the indented code, found no missing or extra ends or ifs, maybe u guys can now see whats wrong
ive spent all day going over each line trying to find what wrong, went over the whole damn script 20 times
now the prblem seems to be, when BonusID is set to 4 which is supposed to call regular grenades if clusters werent bought, even if i tell it to spawn grenades on a player regardless of conditions
GiveBonus(ID,4);
it doesnt work, but why would it work one day and not the next, most of the stuff that u see in the script is what ive tried to debug, it shouldnt stop working one day but work the other day if you know what i mean, maybe i missed something along the way but it was working perfect before ??? ??? wtf!!!!
var
Cash:Integer;
i,BonusID,ID,HC,EBN,EBNM,ED,EDM,DED:Byte;
Command:String;
deathexp: Boolean;
procedure Nova(const X,Y,speed,decentralize,power: single; ID,style: byte; n: integer);
var i: integer;
angle: single;
begin
angle := 2*pi/n;
for i:=0 to n do
CreateBullet(X+cos(angle*i)*decentralize, Y+sin(angle*i)*decentralize, cos(angle*i)*speed, sin(angle*i)*speed, power,style , ID );
end;
procedure ActivateServer();
begin
BonusID:=4;
Cash:=0;
//EBN:=3;
//EBNM:=1;
//EDM:=1;
//DED:=25;
end;
procedure OnPlayerKill(Killer, Victim: byte; Weapon: string);
begin
GiveBonus(Killer,BonusID);
Cash :=Cash+1;
if deathexp = true then begin
{for i := 1 to 5 do}
CreateBullet(GetPlayerStat(Victim, 'X'), GetPlayerStat(Victim, 'Y') - 0, 0, 0,100, 4, Killer);
Nova(GetPlayerstat(Victim,'X'),Getplayerstat(Victim,'Y'),0,25,0, Killer,4,3);
//WriteLn('Cash Updated');
//WriteConsole(0,'Global Player Cash: '+inttostr(Cash),$EE81FAA1);
//WriteLn('Cash Displayed');
end;
if Victim = Killer then begin //begin nova
// This message will only happen for selfkilling bots, though.
WriteConsole(0, IDtoName(Victim) + ' just annihilated himself', $00EE0000);
Nova(GetPlayerstat(Killer,'X'),Getplayerstat(Killer,'Y'),20,15,0, Killer,9,75);
end;
end;
function OnPlayerCommand(ID: Byte; Text: string): boolean;
begin
if Text = '/cash' then begin
WriteConsole(0,IdtoName(ID)+' has just requested Cash levels!',$EE81FAA1);
WriteConsole(0,'Global Player Cash: '+inttostr(Cash),$EE81FAA1);
end;
if Text = '/buy pred' then begin
if Cash < 50 then begin
WriteConsole(0,IdtoName(ID)+' just tried to purchase predator, not enough funds!',$EE81FAA1);
end;
if Cash >= 50 then begin
Cash :=Cash-50;
WriteConsole(0,IdtoName(ID)+' has just bought predator for 50 Cash',$EE81FAA1);
end;
end;
if Text = '/buy bes' then begin
if Cash < 65 then begin
WriteConsole(0,IdtoName(ID)+' just tried to purchase berserker, not enough funds!',$EE81FAA1);
end;
if Cash >= 65 then begin
Cash :=Cash-65;
WriteConsole(0,IdtoName(ID)+' has just bought berserker for 65 Cash',$EE81FAA1);
GiveBonus(ID, 2);
end;
end;
if Text = '/buy clusters' then begin
if Cash < 1000 then begin
If BonusID <> 5 then begin
WriteConsole(0,IdtoName(ID)+' just tried to purchase the clusters, not enough funds!',$EE81FAA1);
end;
end;
if BonusID = 5 then begin
WriteConsole(ID,'cluster grenades are already in affect, try normal nades!',$EE81FAA1);
end;
if Cash >= 1000 then begin
If BonusID <> 5 then begin
Cash :=Cash-1000;
BonusID:=5;
WriteConsole(0,IdtoName(ID)+' has just bought the cluster grenade upgrade for 1000 Cash',$EE81FAA1);
GiveBonus(ID,BonusID);
end;
end;
end;
if Text = '/buy nades' then begin
if Cash < 1000 then begin
If BonusID <> 4 then begin
WriteConsole(0,IdtoName(ID)+' just tried to purchase the nades, not enough funds!',$EE81FAA1);
end;
end;
if BonusID = 4 then begin
WriteConsole(ID,'regular grenades are already in affect, try clusters!',$EE81FAA1);
end;
if Cash >= 1000 then begin
If BonusID <> 4 then begin
Cash :=Cash-1000;
BonusID:=4;
WriteConsole(0,IdtoName(ID)+' has just bought the regular grenade upgrade for 1000 Cash',$EE81FAA1);
GiveBonus(ID,BonusID);
end;
end;
end;
//if Text = '/buy dex' then begin
//if Cash < 3000 then begin
//WriteConsole(0,IdtoName(ID)+' just tried to purchase bigger bangs, not enough funds!',$EE81FAA1);
//end;
//if Cash >= 3000 then begin
//EBNM :=EBMN+1:
//EBN :=3*EBNM;
//EDM :=EDM+1;
//ED := (5*EDM)+ED;
//Cash :=Cash-3000;
//WriteConsole(0,IdtoName(ID)+' has just bought bigger bangs for 3000 Cash',$EE81FAA1);
//end;
//end;
//if Text = '/buy holycross' then begin
//if Cash < 1000 then begin
//WriteConsole(0,IdtoName(ID)+' just tried to purchase Holy Cross, not enough funds!',$EE81FAA1);
//end;
//if Cash >= 1000 then begin
//HC:=1;
//WriteConsole(0,IdtoName(ID)+' has just bought Holy Cross for 1000 Cash',$EE81FAA1);
//end;
//end;
if Text = '/items' then begin
WriteConsole(0,'/buy pred - gives u pred bonus - 50 cash',$EE81FAA1);
WriteConsole(0,'/buy bes - gives u berserker bonus - 65 cash',$EE81FAA1);
WriteConsole(0,'/buy clusters - upgrades your nade bonus to clusters - 1000 cash',$EE81FAA1);
WriteConsole(0,'/buy nades - upgrades your cluster bonus to nades - 1000 cash',$EE81FAA1);
WriteConsole(0,'---->grenade upgrades affects whole team',$EE81FAA1);
//WriteConsole(0,'/buy holycross - Kills all zombies in Red Team Base on Red Team score //- 1000 cash',$EE81FAA1);
end;
end;
procedure OnMapChange(NewMap: string);
begin
For i := 0 to Numplayers do
begin
GiveBonus(i, BonusID);
end;
deathexp := true;
end;
procedure OnPlayerRespawn(ID: byte);
begin
GiveBonus(i,BonusID);
end;
//procedure OnJoinTeam(ID, Team: byte);
//begin
//GiveBonus(ID, BonusID);
//end;
//procedure OnFlagScore(ID, TeamFlag: byte);
//begin
//if HC = 1 then begin
//end;
function OnCommand(ID: Byte; Text: string): boolean;
begin
if GetPiece(text,' ',0) = '/raisecash' then begin
Cash := Cash + Strtoint(GetPiece(Text,' ',1));
WriteConsole(0,'Admin has just deposited '+Getpiece(Text,' ',1)+' Global Player Cash!',$EE81FAA1);
end;
if Text = '/deathexplode' then begin
WriteConsole(0,'death explosions enabled', $00EE0000);
WriteLn('death explosions have been enabled by ' + IntToStr(ID) + '!');
deathexp := True;
end;
if Text = '/nodeathexp' then begin
WriteConsole(0,'death explosions disabled', $00EE0000);
WriteLn('death explosions have been disabled by ' + IntToStr(ID) + '!');
deathexp := False;
end;
end;
-
Don't write so long sentences and uppercase the start of a new please!
And please explain better what you mean, I can't understand that, maybe someone else does, but I didn't.
Please also only post the part of the code where you need help in ;)
However, that's what I think you meant:
When someone buys something, he gets normal nades if clusters weren't purchased.
But when clusters were bought, he gets them?
-
lets try this again,
normally when a player joins, BonusID is set to 4, thats if some one hasnt bought clusters, so nades is normal, when they join they should get a nadepack, when they kill they should get a nadepack
normal nadepacks arent working, but if someone buys clusters, clusters work fine, if they buy normal nades again, NORMAL NADES ARENT WORKING, they ARENT being GIVEN
why arent normal nades working?
why did i post the full code?
because, as I said when i first posted, I dont know where the problem is
so i cant post any particular section
since i
DONT know where the problem IS
something, somewhere in the code is causing some sort of conflict but i dont know what
thats what im asking for help about, if you would bother to read the full post you would have figured that out
why else do u think i haven't posted a section of the code but instead posted the full script?
btw the uppercase ASAP is short for As Soon As Possible for future ref
ill say it again if the code for 'buy dex' is COMMENTED OUT then it compiles but if its UNCOMMENTED it doesnt compile,
ill say my problems AGAIN here:
-GiveBonus is not giving normal nades at all, its ONLY giving CLUSTERS, NOT NORMAL GRENADES! WAS WORKING A FEW DAYS AGO BUT WILL NOT WORK TODAY!
-code for '/buy dex' is not compiling in the script when UNCOMMENTED
if Text = '/buy dex' then begin
if Cash < 3000 then begin
WriteConsole(0,IdtoName(ID)+' just tried to purchase bigger bangs, not enough funds!',$EE81FAA1);
end;
if Cash >= 3000 then begin
EBNM :=EBMN+1:
EBN :=3*EBNM;
EDM :=EDM+1;
ED := (5*EDM)+ED;
Cash :=Cash-3000;
WriteConsole(0,IdtoName(ID)+' has just bought bigger bangs for 3000 Cash',$EE81FAA1);
end;
end;
THIS /\ is the code for BUY DEX
var
Cash:Integer;
i,BonusID,ID,HC,EBN,EBNM,ED,EDM,DED:Byte;
Command:String;
deathexp: Boolean;
procedure Nova(const X,Y,speed,decentralize,power: single; ID,style: byte; n: integer);
var i: integer;
angle: single;
begin
angle := 2*pi/n;
for i:=0 to n do
CreateBullet(X+cos(angle*i)*decentralize, Y+sin(angle*i)*decentralize, cos(angle*i)*speed, sin(angle*i)*speed, power,style , ID );
end;
procedure ActivateServer();
begin
BonusID:=4;
Cash:=0;
//EBN:=3;
//EBNM:=1;
//EDM:=1;
//DED:=25;
end;
procedure OnPlayerKill(Killer, Victim: byte; Weapon: string);
begin
GiveBonus(Killer,BonusID);
Cash :=Cash+1;
if deathexp = true then begin
{for i := 1 to 5 do}
CreateBullet(GetPlayerStat(Victim, 'X'), GetPlayerStat(Victim, 'Y') - 0, 0, 0,100, 4, Killer);
Nova(GetPlayerstat(Victim,'X'),Getplayerstat(Victim,'Y'),0,25,0, Killer,4,3);
//WriteLn('Cash Updated');
//WriteConsole(0,'Global Player Cash: '+inttostr(Cash),$EE81FAA1);
//WriteLn('Cash Displayed');
end;
if Victim = Killer then begin //begin nova
// This message will only happen for selfkilling bots, though.
WriteConsole(0, IDtoName(Victim) + ' just annihilated himself', $00EE0000);
Nova(GetPlayerstat(Killer,'X'),Getplayerstat(Killer,'Y'),20,15,0, Killer,9,75);
end;
end;
function OnPlayerCommand(ID: Byte; Text: string): boolean;
begin
if Text = '/cash' then begin
WriteConsole(0,IdtoName(ID)+' has just requested Cash levels!',$EE81FAA1);
WriteConsole(0,'Global Player Cash: '+inttostr(Cash),$EE81FAA1);
end;
if Text = '/buy pred' then begin
if Cash < 50 then begin
WriteConsole(0,IdtoName(ID)+' just tried to purchase predator, not enough funds!',$EE81FAA1);
end;
if Cash >= 50 then begin
Cash :=Cash-50;
WriteConsole(0,IdtoName(ID)+' has just bought predator for 50 Cash',$EE81FAA1);
end;
end;
if Text = '/buy bes' then begin
if Cash < 65 then begin
WriteConsole(0,IdtoName(ID)+' just tried to purchase berserker, not enough funds!',$EE81FAA1);
end;
if Cash >= 65 then begin
Cash :=Cash-65;
WriteConsole(0,IdtoName(ID)+' has just bought berserker for 65 Cash',$EE81FAA1);
GiveBonus(ID, 2);
end;
end;
if Text = '/buy clusters' then begin
if Cash < 1000 then begin
If BonusID <> 5 then begin
WriteConsole(0,IdtoName(ID)+' just tried to purchase the clusters, not enough funds!',$EE81FAA1);
end;
end;
if BonusID = 5 then begin
WriteConsole(ID,'cluster grenades are already in affect, try normal nades!',$EE81FAA1);
end;
if Cash >= 1000 then begin
If BonusID <> 5 then begin
Cash :=Cash-1000;
BonusID:=5;
WriteConsole(0,IdtoName(ID)+' has just bought the cluster grenade upgrade for 1000 Cash',$EE81FAA1);
GiveBonus(ID,BonusID);
end;
end;
end;
if Text = '/buy nades' then begin
if Cash < 1000 then begin
If BonusID <> 4 then begin
WriteConsole(0,IdtoName(ID)+' just tried to purchase the nades, not enough funds!',$EE81FAA1);
end;
end;
if BonusID = 4 then begin
WriteConsole(ID,'regular grenades are already in affect, try clusters!',$EE81FAA1);
end;
if Cash >= 1000 then begin
If BonusID <> 4 then begin
Cash :=Cash-1000;
BonusID:=4;
WriteConsole(0,IdtoName(ID)+' has just bought the regular grenade upgrade for 1000 Cash',$EE81FAA1);
GiveBonus(ID,BonusID);
end;
end;
end;
//if Text = '/buy dex' then begin
//if Cash < 3000 then begin
//WriteConsole(0,IdtoName(ID)+' just tried to purchase bigger bangs, not enough funds!',$EE81FAA1);
//end;
//if Cash >= 3000 then begin
//EBNM :=EBMN+1:
//EBN :=3*EBNM;
//EDM :=EDM+1;
//ED := (5*EDM)+ED;
//Cash :=Cash-3000;
//WriteConsole(0,IdtoName(ID)+' has just bought bigger bangs for 3000 Cash',$EE81FAA1);
//end;
//end;
//if Text = '/buy holycross' then begin
//if Cash < 1000 then begin
//WriteConsole(0,IdtoName(ID)+' just tried to purchase Holy Cross, not enough funds!',$EE81FAA1);
//end;
//if Cash >= 1000 then begin
//HC:=1;
//WriteConsole(0,IdtoName(ID)+' has just bought Holy Cross for 1000 Cash',$EE81FAA1);
//end;
//end;
if Text = '/items' then begin
WriteConsole(0,'/buy pred - gives u pred bonus - 50 cash',$EE81FAA1);
WriteConsole(0,'/buy bes - gives u berserker bonus - 65 cash',$EE81FAA1);
WriteConsole(0,'/buy clusters - upgrades your nade bonus to clusters - 1000 cash',$EE81FAA1);
WriteConsole(0,'/buy nades - upgrades your cluster bonus to nades - 1000 cash',$EE81FAA1);
WriteConsole(0,'---->grenade upgrades affects whole team',$EE81FAA1);
//WriteConsole(0,'/buy holycross - Kills all zombies in Red Team Base on Red Team score //- 1000 cash',$EE81FAA1);
end;
end;
procedure OnMapChange(NewMap: string);
begin
For i := 0 to Numplayers do
begin
GiveBonus(i, BonusID);
end;
deathexp := true;
end;
procedure OnPlayerRespawn(ID: byte);
begin
GiveBonus(i,BonusID);
end;
//procedure OnJoinTeam(ID, Team: byte);
//begin
//GiveBonus(ID, BonusID);
//end;
//procedure OnFlagScore(ID, TeamFlag: byte);
//begin
//if HC = 1 then begin
//end;
function OnCommand(ID: Byte; Text: string): boolean;
begin
if GetPiece(text,' ',0) = '/raisecash' then begin
Cash := Cash + Strtoint(GetPiece(Text,' ',1));
WriteConsole(0,'Admin has just deposited '+Getpiece(Text,' ',1)+' Global Player Cash!',$EE81FAA1);
end;
if Text = '/deathexplode' then begin
WriteConsole(0,'death explosions enabled', $00EE0000);
WriteLn('death explosions have been enabled by ' + IntToStr(ID) + '!');
deathexp := True;
end;
if Text = '/nodeathexp' then begin
WriteConsole(0,'death explosions disabled', $00EE0000);
WriteLn('death explosions have been disabled by ' + IntToStr(ID) + '!');
deathexp := False;
end;
end;
This is the SCRIPT code, i am having trouble with BOTH, read through BOTH of them PLEASE
-
Solutions for nade:
1. Player has clusters, you want to replace them with normal nades. Not possible, don't ask, just doesn't work.
2. You want to give him normal nades, but give him instead clusters, maybe invalid bonus ID.
3. Maybe set the var to the wrong value somewhere.
4. Idk anything else what could cause that.
What is the error which the dex part is throwing? Can't see anything which could cause errors.
-
normally it DOES give normal grenades on kill and on respawn, and 2 days ago Givebonus WAS giving normal nades, if someone buys clusters then the player gets clusters, if they dont like the clusters they can revert to regular grenades, normally they start with regular grenades so they should get some sort of grenade regardless
however as soon as i added some variables to the script, Givebonus stopped giving regular grenades, problem is i never changed the GiveBonus code since it was actually working, thats what im confused over, has one of the variables somehow conflicted with it? (doubt it, but i dont get what else could trigger this problem as thats the only thing ive added before it stopped working, along with a couple of commands i added to the bottom of the script, Givebonus isnt set to any of the new variables, its still set to BonusID) i dont get it, BonusID is somehow not being assigned to its number, doc for Givebonus can be found here: http://devs.soldat.pl/wiki/index.php?title=GiveBonus (http://devs.soldat.pl/wiki/index.php?title=GiveBonus) as u can see, 4 is regular grenades
Players should be getting some sort of nade pack regardless but get nothing UNTIL someone buys clusters
some points about your solutions:
1. no i was doing it the other day it WAS working, from nades to clusters then clusters to nades, it was working perfect
2. i have checked all BonusID pointing to the commands, all are as i had them when it was working, maybe i need to make a new variable as it seems to have gotten confused with another var somehow
3 i have checked and double checked, the code for Givebonus is exact the same as when it was working flawlessly
when uncommented the code for dex is throwing me an รญdentifier expected error on the line just above the code for it (empty line, line 111) no missing begins or ends or extra ones for that matter
can anyone see why its throwing me that error?
Edit/\: indented the code for buy dex
-
Highly doubtful that this is the problem but GetPlayerStat(ID, 'Name') is preferred over IDtoName(ID) (at least its more... uhm... enesce-liking and me-liking xD)
Temporary replace BonusID with the number 4 itself in the spot its necessary maybe.. or just WriteLn BonusID to see if it actually was set properly before you GiveBonus.
-
if Text = '/buy dex' then begin
if Cash < 3000 then begin
WriteConsole(0,IdtoName(ID)+' just tried to purchase bigger bangs, not enough funds!',$EE81FAA1);
end;
if Cash >= 3000 then begin
EBNM :=EBMN+1: //look a little closer at the entirety of this line... EBMN doesn't exist, and why is it terminated with a colon?
EBN :=3*EBNM;
EDM :=EDM+1;
ED := (5*EDM)+ED;
Cash :=Cash-3000;
WriteConsole(0,IdtoName(ID)+' has just bought bigger bangs for 3000 Cash',$EE81FAA1);
end;
end;
I never encountered any problems on line 111 or any of the lines before it... Might've just been the compiler being retarculous.
-
oops, thanks spilt
EBNM does exist, its defined as a global variable
ill point it out:
var
Cash:Integer;
i,BonusID,ID,HC,EBN,EBNM,ED,EDM,DED:Byte; //its here...on this line.
Command:String;
deathexp: Boolean;
that code, the one for 'buy dex' is part of the rest of the script, the colon is probably whats causing the identifier expected error as it doesnt know what the EBNM:=EBNM+1 means
oops spotted another typo, EBMN should be EBNM
thanks guys now it works :)
From: April 06, 2010, 01:37:23 pm
now to figure out nades, ill do it later, no time now...
-
Hm?
If someone buys nades, EVERYONE will get nades - same with clusters. Is that meant to be so?
Also, everyone has the same amount of money.. is that also meant to be so?
-
Hm?
If someone buys nades, EVERYONE will get nades - same with clusters. Is that meant to be so?
Also, everyone has the same amount of money.. is that also meant to be so?
yes, normally players start with getting normal nades on kill and on spawn, problem is, NOONE is getting any normal nades, the only thing they do get is clusters, thats the problem im working on, getting it to give normal nades again, even if they do buy nades they are not getting any because the script wont give any normal nades, thats what im trying to figure out
EVERYBODY should be getting nades, yes but for some some reason they are NOT, They only DO get nades if Clusters are set
If someone buys nades, EVERYONE will get nades - same with clusters. Is that meant to be so?
to answer your question yes, but they dont need to buy nades, as they should be getting normal nades to start with, only time they need to buy nades is when they want to change FROM nades to clusters or back TO nades FROM clusters
Also, everyone has the same amount of money.. is that also meant to be so?
yes, this server encourages teamwork, so tactical buying of items is needed, altho its not like cash aint easy to get on my server, I've seen it get up to more than 1500 in an hour (3000 if mass zombie spawning happens, altho normally the mas spawning doesn't last long before they accidentally boost a zombie into the spawning team, killing all of them using a suicide bomb)
Off-topic: also some improvements I've made to the script are making it harder and harder to mass spawn, mass spawning causes my server to lag and in some cases crash, thats why I'm working against mass spawning, a little bit of mass spawn to get flag is fine, but continual mass spawn just causes a problem, eventually someones gonna screw up and its gonna kill all the spawning members when they do
From: April 07, 2010, 02:29:39 am
ok ive tried a debug, havent needed to add any write things, a player completed it for me and i didnt even have to ask
if BonusID = 4 then begin
WriteConsole(ID,'regular grenades are already in affect, try clusters!',$EE81FAA1);
end;
a player joins the server, noticing immediately he has no nades or there are none to pick up, suddenly a server info message appears to chech cash using /cash, he does so, soon after a server info message appears saying to use /items to see items for sale, he notices that he can 'buy nades' and has enough cash, so he types /buy nades, but then the 'nades already in effect' message shows up in his console
this message will only appear if BonusID is actually set to 4,
so, something is stopping Givebonus from giving any of the players normal nades through any of the events,
i even tried changing the BonusID to 4 in the actual Givebonus command and it still wont give normal nades
Player has clusters, you want to replace them with normal nades. Not possible, don't ask, just doesn't work.
the situation is different, player has NOTHING and im trying to give him nades but it wont work
however, having said that, i recently changed the setting for bonuses appearing to Never, since then its sorta stopped working, but if that was the case wouldnt that also stop pred, beserker and clusters from being given? as they are all bonuses?
i dont understand whats stopping it from working
From: April 07, 2010, 03:07:21 am
i just set the bonuses appearing to always and its still not giving the normal nades, if normal nades is set as the bonus to give, if someone picks up a cluster set, then once they kill they disappear, so its like the game is trying to give the players the nades but for some reason is unable to
-
oops, thanks spilt
EBNM does exist, its defined as a global variable
...
oops spotted another typo, EBMN should be EBNM
That's sorta what I was pointing out... :P
Also, what is your Max_Grenades value in soldat.ini?
-
I haven't read all, but if givebonus seems to be bugging, have you tried spawnobject instead of givebonus to deliver nades?
SpawnObject(getPlayerStat(ID, 'x'), getPlayerStat(ID, 'y')-5, 17);
-
yes, i was using that originally but after about a minute players would have to find nadepacks instead of getting nade packs when they kill, and killobject was bugging on me also (useless, was deleting nothing whatsoever) so thats why i looked for an alternative
@Spilt: 5, but why would that affect it as it was working one day and not the next? every day the server auto resets...
From: April 07, 2010, 01:37:21 pm
as spilt seems to be pointing towards settings, heres my soldat.ini
[GAME]
Fullscreen=0
Debug_Mode=0
Console_Show=1
Console_Deaths=1
Respawn_Time=0
WaveRespawn_Time=600
Mouse_Sensitivity=100
Play_Music=0
Deathmatch_Limit=30
Pointmatch_Limit=30
Teammatch_Limit=60
Capture_Limit=5
Rambomatch_Limit=30
Infiltration_Limit=90
Hold_Limit=80
GameStyle=3
Friendly_Fire=0
Guns_Collide=0
Kits_Collide=0
Play_Intro=0
Loop_Maps=1
Bonus_Frequency=5
Bonus_FlameGod=0
Bonus_Predator=1
Bonus_Berserker=1
Bonus_Vest=1
Bonus_Cluster=1
Time_Limit=15
Survival_Mode=0
Realistic_Mode=0
Weapons_Mode=0
Weapon_1=1
Weapon_2=1
Weapon_3=1
Weapon_4=1
Weapon_5=1
Weapon_6=1
Weapon_7=1
Weapon_8=1
Weapon_9=1
Weapon_10=1
Weapon_11=1
Weapon_12=1
Weapon_13=1
Weapon_14=1
Max_Grenades=0
Random_Bots=0
Random_Bots_1=0
Random_Bots_2=0
Random_Bots_3=0
Random_Bots_4=0
Runs=1
Profile_Default=0
Logging=1
Stationary_Guns=1
End_Screenshot=0
Auto_Record=0
Record_Time=2
Bullet_Time=1
NoSniperLine=0
KillConsole_Length=15
MainConsole_Length=6
Advance_Amount=2
Blue_Points_Time=5
Red_Points_Capture=30
HTF_Points_Time=5
MiniMap_Pos_X=285
MiniMap_Pos_Y=5
Radio=1
[GRAPHICS]
Adapter=1
Color_Depth=32
Refresh_Rate=Default
Dithering=0
Swap_Effect=1
BackBuffers=2
Interface_Status_Alpha=200
Gradient_Background=0
Compatibility=0
Antialiasing=0
Texture_Filter=2
Software=0
Bonus_Colors=1
Max_Particles=358
Bullet_Trails=1
Player_Indicator=1
Sniper_Line=1
Weather=1
Interface=Default
Smooth_Edges=0
Window_Resize=0
Screen_Width=640
Screen_Height=480
Gamma=116
MiniMap_Transparency=230
[SOUND]
Volume=77
Music_Volume=100
Max_Channels=64
Bit_Rate=22050
Output=0
Driver=0
Effect1=1
Effect2=1
Mp3List=0
[NETWORK]
Port=23098
JoinPort=23098
Max_Players=23
Default_Remote_Host=
Game_Password=
Admin_Password=******
Connection=Internet
Lobby_Register=1
ASE_Register=1
Lobby_IP=65.169.85.3
Server_Name=#1 Frostys Gather[US]
Dedicated=1
Clanmatch=0
Internet_Connection=3
Greeting_Message=Welcome to Frostys Gather[US]
Greeting_Message2=this is a scripted server, so whatch out for unepected events
Greeting_Message3=Have fun, new scripts are being added all the time
Server_Info=Server Hosted by http://rent.enesce.com
ShowRealLag=1
Min_Ping=0
Max_Ping=9999
Filter_Players=0
Filter_Gametype=0
Filter_Dedicated=0
Filter_NoPassword=0
Filter_NoBots=0
Filter_Survival=0
Filter_Realistic=0
Filter_NoBonuses=0
Filter_Weapons=0
Filter_WeaponsMod=0
Filter_BE=0
Balance_Teams=1
Dont_Forward=0
Vote_Percent=75
Compression=1
Spectator=0
Max_Spectators=3
Spectator_Chat=1
Allow_Download=1
MaxConnections=8
TooMuch_Packets_LAN=99999
TooMuch_Packets_Internet=99999
Flooding_Packets_LAN=99999
Flooding_Packets_Internet=99999
Vote_Cheat_Warnings=8
Max_KnifeCheat_Warnings=14
Disable_AntiCheat_Kick=1
LogFilesUpdate=3600
Max_Flood_Warnings=99999
Max_Ping_Warnings=99999
T1_Snapshot=35
T1_MajorSnapshot=19
T1_DeadSnapshot=50
T1_Heartbeat=135
T1_Delta=4
T1_Ping=21
T1_ThingSnapshot=31
PacketRate_Adjusting=0
ClientPort=23083
BattlEye_Anti_Cheat=0
Disable_Minimap=0
Advanced_Spectate=1
[PLAYER]
Name=Soldier
Main_Color=$001265AF
Pants_Color=$00296938
Skin_Color=16777215
Hair_Color=clWhite
Jet_Color=clWhite
Hair_Style=4
Head_Style=0
Chain_Style=2
Sec_Weapon=0
[CONTROLS]
Left=30
Right=32
Jump=17
Crouch=31
Fire=mb0
Fly=mb1
Grenade=18
Change=16
Drop=33
Reload=19
Chat=20
Prone=45
TeamChat=21
Weapons=15
[BOTS]
Difficulty=50
Chat=1
Raycasting_Quality=15
-
for god's sake, dont post such huge pieces of text here, PLEASE. Use some paste service like nopaste or pastebin >.< The pages takes ages to load.
Thanks.
Also, you missed some points, here you are (in case you ran out): ................................................. .
Use them well, they help making your posts more readable :|
Sorry if you wanted some help on topic, but your walls of text are absolutely unreadable.
-
ok well heres my soldat.ini
<link removed by author>
note: this link will expire in 1 month
From: April 08, 2010, 12:54:18 am
ok i changed the max grenades to 10 which is what i wanted the value to be and now, magically we have nades. haha i suck.
thanks alot spilt you have just ended my headache ;)
-
What a guess! :D
-
new problem:
http://pastebin.com/fjKxxADT (http://pastebin.com/fjKxxADT)
basically i have tried to add a cost increaser and dynamic cost for buy dex. See the pastebin for full details.
getting a type mismatch error
for those who have just gone through the pastebin:
DEC is constantly increasing and already goes past the limit for Byte but is perfect for Integer
same as DECC
so why is the compiler throwing me the error?
btw i am using my server to test new code, so my server is now offline until the problem is solved
any good pascal compilers out there i can use that are EASY to use? so that debugging will be simpler as i will be able to copy and paste code, and find out the errors that way?
-
DEC is an Integer, but you're trying to use it in a String. You have to use IntToStr on DEC to convert it from an Integer to a String to write it to console.
WriteConsole(0,IdtoName(ID)+' has just bought bigger bangs for '+DEC+' Cash',$EE81FAA1);
//try this instead
WriteConsole(0,IdtoName(ID)+' has just bought bigger bangs for '+IntToStr(DEC)+' Cash',$EE81FAA1);
-
any good pascal compilers out there i can use that are EASY to use? so that debugging will be simpler as i will be able to copy and paste code, and find out the errors that way?
pascal compilers would choke on scriptcore code and bleed to death. Use this instead: http://forums.soldat.pl/index.php?topic=26011.msg305925#msg305925
-
thanks, now it works perfect :)
From: April 10, 2010, 10:38:04 pm
getting an assignment expected error as soon as i added these parts of code, again its not pointing to any of these sections but once i comment them out it works, even the pascal IDE doesnt see what the problem is
http://pastebin.com/vrxTBmXL (http://pastebin.com/vrxTBmXL)
-
line 15 in the paste
for i := 1 to NumPlayers do
-
actually, the NumPlayers works only on the newest beta server version.
-
I'm sure you mean HighestID.
-
no, Numplayers works fine
i was just missing the : next to the =
now its workng perfect, so Numplayers must work on both the beta and older versions if its working in my script
-
no no he really does mean HighestID. if you have 3 players in-game, ids are 1, 2, and 4 (since player # 3 left), i will become 1, 2, then 3.. thats it... player id 4 will never get accessed.
or just use 32 if ur not using that version of scripting core (too lazy to look through the topic :P)
-
Numplayers works fine
did u even read that bit? i know that he did mean HighestID but
NumPlayers IS working PERFECTLY
please do not post if you havent read the topic, that is really annoying :P
From: April 12, 2010, 01:00:05 am
// if Text = '/buy ally' then begin
if Cash < 10000 then begin
WriteConsole(0,IdtoName(ID)+' just tried to purchase an ally, not enough funds!',$EE81FAA1);
end;
if Cash >= 10000 then begin
Cash :=Cash-10000;
Command('/setteam1 '+inttostr(Botn));
WriteConsole(0,IdtoName(ID)+' has just bought an ally for 10000 Cash',$EE81FAA1);
end;
end;
this section of code is giving me a type mismatch error, again not pointing to this section but once its commented out it compiles
Botn is a Byte, how to i convert byte to string?
From: April 12, 2010, 01:03:30 am
also for some reason this line type gives me a type mismatch error
i have 2 lines exactly like this
Command('/maxrespawntime 20');
-
Numplayers works fine
did u even read that bit? i know that he did mean HighestID but
NumPlayers IS working PERFECTLY
please do not post if you havent read the topic, that is really annoying :P
That might be the case, but when iterating through all players, it's not a particularly good idea to use NumPlayers, since it's possible to get players who have IDs that are higher than NumPlayers is, and so you never perform operations on them.
Take, for example, a full server. Then it diminishes to two people in slots 1 and 12 (so NumPlayers will be 2). Anything you try to do with a for loop using NumPlayers will only affect the first player; the second player has an ID greater than what NumPlayers has.
In 2.6.5, I'd recommend using 32 instead of NumPlayers, and in 2.7.0, since HighestID is implemented in the 2.7.0 ScriptCore, use HighestID over NumPlayers.
Just food for thought. :)
-
thankyou spilt, now how do i get my code to work? please see below the post that you quoted
-
When you get an error, the reported line number that the ScriptCore gives you is a couple of lines ahead for whatever reason (really annoying). You'll have to post some of the code that precedes those two sections of code, just in case the error is actually occurring there.
-
but if the error isnt occuring when those lines are commented out then the script wouldnt even compile so how can that be? but anyways heres the code for those two lines
if Text = '/deathexplode' then begin
WriteConsole(0,'death explosions enabled', $00EE0000);
//Command('/maxrespawntime 20');
WriteLn('death explosions have been enabled by ' + IntToStr(ID) + '!');
deathexp := True;
end;
if Text = '/nodeathexp' then begin
WriteConsole(0,'death explosions disabled', $00EE0000);
//Command('/maxrespawntime 2');
WriteLn('death explosions have been disabled by ' + IntToStr(ID) + '!');
deathexp := False;
end;
please answer my question
how do i convert a byte to string
and why is this code giving me a type mismatch error?
if Text = '/buy ally' then begin
if Cash < 10000 then begin
WriteConsole(0,IdtoName(ID)+' just tried to purchase an ally, not enough funds!',$EE81FAA1);
end;
if Cash >= 10000 then begin
Cash :=Cash-10000;
Command('/setteam1 '+inttostr(Botn));
WriteConsole(0,IdtoName(ID)+' has just bought an ally for 10000 Cash',$EE81FAA1);
end;
end;
Botn is a byte, i am trying to convert it to string but cannot find any syntax that allows it
i mean inttostr is on neither of these sites, so whats the best place to get ALL the syntax for soldat?
these are the sites i have, not even the syntax for Copy is there:
http://devs.soldat.pl/wiki/index.php?title=Category:Server_Scripting (http://devs.soldat.pl/wiki/index.php?title=Category:Server_Scripting)
http://enesce.com/help/ (http://enesce.com/help/)
From: April 13, 2010, 02:46:07 am
Bump
-
omg type conversion ;_;
inttostr to convert byte, integer and longint to string (reverse - strtoint)
floattostr to convert single and double to string (reverse - strtofloat)
strtoint and strtofloat should also work on the char type i think
-
@dnmr: forgot type extended for floattostr / strtofloat; Iuuno about char, but should be noted: Chr for Byte -> Char and Ord for Char -> Byte (which then can be InttoStr / StrtoInt`ed).
-
@dnmr: forgot type extended for floattostr / strtofloat; Iuuno about char, but should be noted: Chr for Byte -> Char and Ord for Char -> Byte (which then can be InttoStr / StrtoInt`ed).
wellll, you could add word and whatnot you guys have in there. Never used them though, so didnt want to complicate things by using more weird terms |:
-
@dnmr: forgot type extended for floattostr / strtofloat; Iuuno about char, but should be noted: Chr for Byte -> Char and Ord for Char -> Byte (which then can be InttoStr / StrtoInt`ed).
wellll, you could add word and whatnot you guys have in there. Never used them though, so didnt want to complicate things by using more weird terms |:
good point, sorryz (and i feel silly for completely forgetting about the million other types of integers heh) :(
InttoStr converts any sort of integer into a string, vice-versa is StrtoInt
FloattoStr converts any sort of floating point value into a string; StrtoFloat is vice-versa
-
btw HighestID doesnt work
i changed NumPlayers to HighestID and im getting errors as a result
Unknown identifier 'HighestID'
-
As mentioned earlier, HighestID is only implemented in the 2.7.0 ScriptCore. In the 2.6.5 ScriptCore, you will have to use something else instead (like 32).
-
or make a custom function which calculates HighestID for you. You'll need to use it on player join/leave and on adding bots
-
or make a custom function which calculates HighestID for you. You'll need to use it on player join/leave and on adding bots
custom function not needed
all i really need is this, after defining HighestID as a variable:
HighestID:=Numplayers+Numbots;
i think this would be better than just NumPlayers, although Numplayers is counting Bots also, Numplayers isnt just counting players its counting bots also
i had to do this in one of my scripts just to get the number of JUST players, this was done during a debug, now the script for it works perfect, without this line and PlayersActive being Numplayers that script is then a junk heap ><:
PlayersActive := NumPlayers - Numbots
see? i had to subtract the number of bots from the number of players to get the ACTUAL number of players, else what i had set as an if would fail completely, thus, me saying: Numplayers ISNT just counting players its counting bots also
dnmr, was it you who said Numplayers was counting players only? :P
in case ur wondering this is what i found out during my debug:
http://pastebin.com/8kfbG17R (http://pastebin.com/8kfbG17R)
-
You can't use NumPlayers either NumBots in either way to calculate the highest ID. Maybe there is a player with ID 20, and 12 humans or bots are on the server.
Anyway, that's the best & easiest way:
function HighestID: byte;
begin
for Result := 32 downto 1 do
if GetPlayerStat(Result, 'Active') = true then
break;
end;
-
Just do to 32, it is the easiest, and unless you have many many nested loops, it isn't going to be an issue when it comes to performance. And its easier to be sure the code is correct too. At least that's my opinion.
-
well if i do use 32, then if it comes across a number that doesn't match an id the script tends to "crash"
dunno why
ur code will prolly work better swompie :D
-
If your code is crashing with 1 to 32, you're doing something wrong in your script. Using another number there is not the way to fix this problem.
-
always check if the player is active before doing something with him, and you shouldnt have any problems
-
Function Setteam(ID,Team:Byte):String;
begin
Command('/setteam'+Floattostr(Team)+' '+Floattostr(ID));
end;
function OnPlayerCommand(ID: Byte; Text: string): boolean;
begin
if Text = '/red' then
begin
Setteam(ID,1);
end;
end;
[8:11] syntax error
what????
-
[...]
what????
Try this one.
Procedure SetTeam(ID, Team: Byte);
Begin
Command('/setteam'+IntToStr(Team)+' '+IntToStr(ID));
end;
You don't need to use FloatToStr(). It's an Integer value, not a Float one ;)
Although, I don't see the point at making this Procedure. It's just a line, ffs. Go Command() instead.
Well, I would. It's your choice.
-
Edit above
thanks tho squiddy
tho if i use Command it errors with numbers if its in the script that why i have to use a function
but now why am i getting a syntax error?
From: April 16, 2010, 05:56:30 pm
nvm soon as i added ur code it stopped erroring
From: April 16, 2010, 06:01:56 pm
actually no
Procedure SetTeam(ID, Team: Byte);
begin
Command('/setteam'+IntToStr(Team)+' '+IntToStr(ID));
end;
function OnPlayerCommand(ID: Byte; Text: string): boolean;
begin
if Text = '/red' then
begin
Setteam(ID,1);
end;
if Text = '/spec' then
begin
Setteam(ID,5);
end;
end;
function OnCommand(ID: Byte; Text: string): boolean;
begin
if Text = '/blue' then
begin
Setteam(ID,2);
end;
if Text = '/green' then
begin
Setteam(ID,3);
end;
if Text = '/yellow' then
begin
Setteam(ID,4);
end;
end;
1:34 colon expected
or i get unexpected end of file (3:32)
-
[...]
tho if i use Command it errors with numbers if its in the script that why i have to use a function
[...]
I believe you meant that when you use Command() it crashes ?
Well, just go "Command('/setteam5 '+IntToStr(ID));", to change player ID to spectators.
Your welcome for the code. ;)
Any more questions, feel free to ask :D
-
var
Cash,DEC,DECC,Botn,EBNN,EBNND,EBNNT,EDMM,EDMMT,EDMMD:Integer;
BonusID,ID,EBN,EBNM,ED,EDM,DED,i:Byte;
Command:String;
deathexp,HC: Boolean;
function HighestID: byte;
begin
for Result := 32 downto 1 do
if GetPlayerStat(Result, 'Active') = true then
break;
end;
[9:2] unexpected end of file
[9:2] syntax error
darn it >=(
-
Did you try to start the server without HighestID code? Can't see any fails currently. Wther semicolon fails or such a thing, I've always got that error when I had an ยด or ` somewhere in the script placed out of a type mistake.
-
it only failed when i added the HighestID Code, yes i did try to start the server just before adding
but as soon as i comment it out it works fine so wtf
and i dont see any sytax errors, all working if statements that have a true or false answer are exact
-
Try this:
Function HighestID(): Byte;
Var Dude: Byte;
Begin
For Dude := 32 DownTo 1 Do if GetPlayerStat(Dude,'Active') = True Then Break;
Result := Dude;
end;
Always when you get such an errorr like that, write it all over again, with different Vars. Might help.
-
[2:2]syntax error
[2:2]begin expected
and if i move the var to the global vars i get this:
[3:2]syntax error
[3:2]unexpected end of file
which points to line 4 on your code since line 3 was moved and line 4 became line 3
-
Can you post the whole code with HighestID, you don't have to :P (In normal code tags or attach w/e you like)
Maybe we can find the error, sth. must cause it since HighestID definetily isn't.
You use the server version 265?
-
it cant be because if thats the case even with HighestID uncommented it wont compile
it ONLY compiles if HightestID is COMMENTED OUT, at the moment its working perfect, ONLY because i have HighestID commented out, anyways heres the full script:
http://pastebin.com/hwRnkARG (http://pastebin.com/hwRnkARG)
it IS compiling but WILL NOT compile with HighestID uncommented
and yes i do believe that the server host is using 265
-
Any other scripts? For me it just compiles fine..
-
it cant be because if thats the case even with HighestID uncommented it wont compile
it ONLY compiles if HightestID is COMMENTED OUT, at the moment its working perfect, ONLY because i have HighestID commented out, anyways heres the full script:
http://pastebin.com/hwRnkARG (http://pastebin.com/hwRnkARG)
it IS compiling but WILL NOT compile with HighestID uncommented
and yes i do believe that the server host is using 265
For the last time! HighestID is not implemented in 2.6.5! Don't use it if you're using a 2.6.5 server! Sheesh!
-
nope, was that compiling with the code for HighestID Uncommented? ie: no //?
From: April 17, 2010, 07:11:31 am
and thankyou spilt, u never said that until now
-
In 2.6.5, I'd recommend using 32 instead of NumPlayers, and in 2.7.0, since HighestID is implemented in the 2.7.0 ScriptCore, use HighestID over NumPlayers.
...or just use 32 if ur not using that version of scripting core (too lazy to look through the topic :P)
As mentioned earlier, HighestID is only implemented in the 2.7.0 ScriptCore. In the 2.6.5 ScriptCore, you will have to use something else instead (like 32).
*sighs*
Thought the implication that I was trying to get through would satisfy your logic circuits... Oh well, at least you understand now. :)
-
@squiddy: less code if used a lot, and looks cleaner imo. I would probably do the same ^^
-
WTF identifier expected
these are the sections of my script that were changed just before this error showed up
var
Cash,DEC,DECC,Botn,EBNN,EBNND,EBNNT,EBNNTT,EDMM,EDMMT,EDMMD:Integer;
BonusID,ID,EBN,EBNM,ED,EDM,DED,i,Dude,DEXN:Byte;
Command:String;
deathexp,HC: Boolean;
procedure ActivateServer();
begin
BonusID:=4;
Cash:=0;
DEC:=3000;
EBN:=2;
EBNM:=1;
EDM:=1;
DED:=25;
//Botn:=2;
DEXN:=1;
EBNN:=EBN*20;
EBNNTT:=22;
EBNNT:=EBNN/3;
EBNND:=EBNNT*2;
EDMM:=DED*EDM;
EDMMT:=EDMM/3;
EDMMD:=EDMMT*2;
end;
if Getplayerstat(Killer,'Name') = 'Mr.Zombie' then begin
for i := 1 to DEXN do Nova(GetPlayerstat(Victim,'X'),Getplayerstat(Victim,'Y'),0,DED*i,25, Victim,10,EBNNTT*i);
// Nova(GetPlayerstat(Victim,'X'),Getplayerstat(Victim,'Y'),0,(DED*EDM)/2,25, Victim,10,EBNND);
// Nova(GetPlayerstat(Victim,'X'),Getplayerstat(Victim,'Y'),0,(DED*EDM)/3,25, Victim,10,EBNNT);
end;
and once again the error does not point to any of these sections but ONLY appeared AFTER these sections ONLY were altered
From: April 17, 2010, 11:41:41 pm
heres the full script just in case i stuffed something else up elsewhere which i doubt:
http://pastebin.com/jF83M4cR (http://pastebin.com/jF83M4cR)
-
Of course you have an error. You dont have any procedures covering that GetPlayerStat() function..
Go:
OnPlayerKill(); //Too lazy to look for it fully :P
Var I: Integer;
Begin
if GetPlayerStat(Killer,'Name') = 'Mr. Zombie' Then Begin
For I := 1 To Dexn Do Nova(); //Again, dunno it..
end;
end;
DorkeyDear, thanks :P
I always try to "clean" my Scripts up :P
-
huh?? what do u mean?
can u plz go over the full script?
im still getting identifier expected error
-
Oh man, I am freaking tired, need to write a freaking book, and need to get some freaking sleep.
Maybe tomorrow I can take a look at it.
This is all I can do for you now.
Sorry if I am quite busy :P
-
well if u cant help til tomorrow then can someone else help plz?
From: April 18, 2010, 12:01:27 am
note, even with the commented sections of code in the full script i am still getting the error
-
if Getplayerstat(Killer,'Name') = 'Mr.Zombie' then begin
for i := 1 to DEXN do Nova(GetPlayerstat(Victim,'X'),Getplayerstat(Victim,'Y'),0,DED*i,25, Victim,10,EBNNTT*i);
// Nova(GetPlayerstat(Victim,'X'),Getplayerstat(Victim,'Y'),0,(DED*EDM)/2,25, Victim,10,EBNND);
// Nova(GetPlayerstat(Victim,'X'),Getplayerstat(Victim,'Y'),0,(DED*EDM)/3,25, Victim,10,EBNNT);
end;
This part of your code isn't part of a procedure.
-
was missing an end after that section of code, tx
From: April 18, 2010, 01:59:57 am
if Text = '/buy ally' then begin
if Cash < 10000 then begin
WriteConsole(0,IdtoName(ID)+' just tried to purchase an ally, not enough funds!',$EE81FAA1);
end;
if Cash >= 10000 then begin
Cash :=Cash-10000;
Command('/setteam1 '+Floattostr(Botn));
WriteConsole(0,IdtoName(ID)+' has just bought an ally for 10000 Cash',$EE81FAA1);
end;
end;
this part of code is giving me a type mismatch
the error does not point to it but once its commented out it works fine
someone help me plz i have asked about this 20 times already!! >=(
-
You already did that a few times.. you should get sth. like a paper or open some text file and write into it what which errors mean and are caused by when you can't save it in your god dam brain. Start to think! Why we even have a brain? -.-" I know were here to help, but these question are slowly making alot of people tired.
That makes me rage -.-" pffft
Anyway..
Look at variables and which type botn is declared at, then you should know what's wrong :P
-
FFS!!!
that sort of answer is what makes me rage
Botn is byte i have tried both Inttostr and Floattostr and it still gives me errors
SO WTF DO I DO, ANSWER ME FOR f**kS SAKES!!!
THATS WHY IM ASKING IN THE FIRST f**kING PLACE!!
Botn is the ONLY var in that section of code, what do i use of Botn is Byte and Inttostr and Floattostr arent working?THATS THE QUESTION!!
im getting a f**king type mismatch
>>>=(
btw, if ppl would answer the fucking question AS SOON AS ITS ASKED this wouldnt happen
-
Byte -> IntToStr not FloatToStr
-
i tried inttostr.....
Command('/setteam1 '+IntToStr(Botn));
this is the line thats causing the error, soon as its commented out or deleted the script compiles
i even tried setting Botn as a string and entering a string value representing a number and even tried using a different var name
-
Pfft, welcome to the scriptcore. Learn to search errors, sometimes it just says there are in some line, but actually they aren't.
Give the code again, i'll try compiling it myself and see if I find the error.
-
the error is not pointing to the bad line
as it has been last few times THE ERROR DOES NOT POINT TO WHERE IT ACTUALLY IS!!! READ FFS
when the above line IS COMMENTED OUT like this :
//Command('/setteam1 '+IntToStr(Bottoset));
then it compiles, the following code DOES compile
var
Cash,DEC,DECC,EBNN,EBNND,EBNNT,EBNNTT,EDMM,EDMMT,EDMMD:Integer;
BonusID,ID,EBN,EBNM,ED,EDM,DED,i,Dude,DEXN,Bottoset,SetBotTeam:Byte;
Command:String;
deathexp,HC: Boolean;
procedure Nova(const X,Y,speed,decentralize,power: single; ID,style: byte; n: integer);
var i: integer;
angle: single;
begin
angle := 2*pi/n;
for i:=0 to n do
CreateBullet(X+cos(angle*i)*decentralize, Y+sin(angle*i)*decentralize, cos(angle*i)*speed, sin(angle*i)*speed, power,style , ID );
end;
procedure ActivateServer();
begin
BonusID:=4;
Cash:=0;
DEC:=3000;
EBN:=2;
EBNM:=1;
EDM:=1;
DED:=47;
Bottoset:=2;
DEXN:=1;
EBNN:=EBN*30;
EBNNTT:=45;
EBNNT:=EBNN/3;
EBNND:=EBNNT*2;
EDMM:=DED*EDM;
EDMMT:=EDMM/3;
EDMMD:=EDMMT*2;
SetBotTeam:=1;
end;
procedure OnPlayerKill(Killer, Victim: byte; Weapon: string);
Var I: Integer;
begin
GiveBonus(Killer,BonusID);
Cash :=Cash+1;
if deathexp = true then begin
{for i := 1 to 5 do}
CreateBullet(GetPlayerStat(Victim, 'X'), GetPlayerStat(Victim, 'Y') - 0, 0, 0,100, 4, Killer);
Nova(GetPlayerstat(Victim,'X'),Getplayerstat(Victim,'Y'),0,DED*EDM,25, Killer,4,EBN*2);
//WriteLn('Cash Updated');
//WriteConsole(0,'Global Player Cash: '+inttostr(Cash),$EE81FAA1);
//WriteLn('Cash Displayed');
end;
if Victim = Killer then begin //begin nova
// This message will only happen for selfkilling bots, though.
WriteConsole(0, IDtoName(Victim) + ' just annihilated himself', $00EE0000);
Nova(GetPlayerstat(Killer,'X'),Getplayerstat(Killer,'Y'),0,35,0, Killer,10,5);
Nova(GetPlayerstat(Victim,'X'),Getplayerstat(Victim,'Y'),0,70,0, Killer,10,25);
Nova(GetPlayerstat(Victim,'X'),Getplayerstat(Victim,'Y'),0,105,0, Killer,10,25);
Nova(GetPlayerstat(Victim,'X'),Getplayerstat(Victim,'Y'),0,140,0, Killer,10,25);
Nova(GetPlayerstat(Victim,'X'),Getplayerstat(Victim,'Y'),0,175,0, Killer,10,25);
Nova(GetPlayerstat(Victim,'X'),Getplayerstat(Victim,'Y'),0,210,0, Killer,10,25);
Nova(GetPlayerstat(Victim,'X'),Getplayerstat(Victim,'Y'),0,245,0, Killer,10,25);
Nova(GetPlayerstat(Victim,'X'),Getplayerstat(Victim,'Y'),0,270,0, Killer,10,25);
Nova(GetPlayerstat(Victim,'X'),Getplayerstat(Victim,'Y'),0,305,0, Killer,10,25);
Nova(GetPlayerstat(Victim,'X'),Getplayerstat(Victim,'Y'),0,340,0, Killer,10,25);
Nova(GetPlayerstat(Victim,'X'),Getplayerstat(Victim,'Y'),0,375,0, Killer,10,75);
Nova(GetPlayerstat(Victim,'X'),Getplayerstat(Victim,'Y'),0,410,0, Killer,10,150);
end;
if Getplayerstat(Killer,'Name') = 'Mr.Zombie' then begin
for I := 1 to DEXN do Nova(GetPlayerstat(Victim,'X'),Getplayerstat(Victim,'Y'),0,DED*i,25, Victim,10,EBNNTT*i);
// Nova(GetPlayerstat(Victim,'X'),Getplayerstat(Victim,'Y'),0,(DED*EDM)/2,25, Victim,10,EBNND);
// Nova(GetPlayerstat(Victim,'X'),Getplayerstat(Victim,'Y'),0,(DED*EDM)/3,25, Victim,10,EBNNT);
end;
end;
function OnPlayerCommand(ID: Byte; Text: string): boolean;
begin
if Text = '/cash' then begin
WriteConsole(0,IdtoName(ID)+' has just requested Cash levels!',$EE81FAA1);
WriteConsole(0,'Global Player Cash: '+inttostr(Cash),$EE81FAA1);
end;
if Text = '/buy pred' then begin
if Cash < 50 then begin
WriteConsole(0,IdtoName(ID)+' just tried to purchase predator, not enough funds!',$EE81FAA1);
end;
if Cash >= 50 then begin
Cash :=Cash-50;
WriteConsole(0,IdtoName(ID)+' has just bought predator for 50 Cash',$EE81FAA1);
end;
end;
if Text = '/buy bes' then begin
if Cash < 65 then begin
WriteConsole(0,IdtoName(ID)+' just tried to purchase berserker, not enough funds!',$EE81FAA1);
end;
if Cash >= 65 then begin
Cash :=Cash-65;
WriteConsole(0,IdtoName(ID)+' has just bought berserker for 65 Cash',$EE81FAA1);
GiveBonus(ID, 2);
end;
end;
if Text = '/buy clusters' then begin
if Cash < 1000 then begin
If BonusID <> 5 then begin
WriteConsole(0,IdtoName(ID)+' just tried to purchase the clusters, not enough funds!',$EE81FAA1);
end;
end;
if BonusID = 5 then begin
WriteConsole(ID,'cluster grenades are already in affect, try normal nades!',$EE81FAA1);
end;
if Cash >= 1000 then begin
If BonusID <> 5 then begin
Cash :=Cash-1000;
BonusID:=5;
WriteConsole(0,IdtoName(ID)+' has just bought the cluster grenade upgrade for 1000 Cash',$EE81FAA1);
GiveBonus(ID,BonusID);
end;
end;
end;
if Text = '/buy nades' then begin
if Cash < 1000 then begin
If BonusID <> 4 then begin
WriteConsole(0,IdtoName(ID)+' just tried to purchase the nades, not enough funds!',$EE81FAA1);
end;
end;
if BonusID = 4 then begin
WriteConsole(ID,'regular grenades are already in affect, try clusters!',$EE81FAA1);
end;
if Cash >= 1000 then begin
If BonusID <> 4 then begin
Cash :=Cash-1000;
BonusID:=4;
WriteConsole(0,IdtoName(ID)+' has just bought the regular grenade upgrade for 1000 Cash',$EE81FAA1);
GiveBonus(ID,BonusID);
end;
end;
end;
if Text = '/buy dex' then begin
if Cash < DEC then begin
WriteConsole(0,IdtoName(ID)+' just tried to purchase bigger bangs, not enough funds!',$EE81FAA1);
end;
if Cash >= DEC then begin
EBNM :=EBNM+1;
EBN :=3*EBNM;
EDM :=EDM+1;
ED := (5*EDM)+ED;
DEXN :=DEXN+1;
WriteConsole(0,IdtoName(ID)+' has just bought bigger bangs for '+inttostr(DEC)+' Cash',$EE81FAA1);
Cash :=Cash-DEC;
DECC :=DEC/3;
DEC :=DEC+DECC;
end;
end;
if Text = '/buy ally' then begin
if Cash < 10000 then begin
WriteConsole(0,IdtoName(ID)+' just tried to purchase an ally, not enough funds!',$EE81FAA1);
end;
if Cash >= 10000 then begin
Cash :=Cash-10000;
//Command('/setteam1 '+IntToStr(Bottoset));
WriteConsole(0,IdtoName(ID)+' has just bought an ally for 10000 Cash',$EE81FAA1);
end;
end;
if Text = '/buy holycross' then begin
if Cash < 10000 then begin
WriteConsole(0,IdtoName(ID)+' just tried to purchase Holy Cross, not enough funds!',$EE81FAA1);
end;
if Cash >= 10000 then begin
HC:=true;
WriteConsole(0,IdtoName(ID)+' has just bought Holy Cross for 10000 Cash',$EE81FAA1);
Cash:=Cash-10000;
end;
end;
if Text = '/items' then begin
WriteConsole(0,'/buy pred - gives u pred bonus - 50 cash',$EE81FAA1);
WriteConsole(0,'/buy bes - gives u berserker bonus - 65 cash',$EE81FAA1);
WriteConsole(0,'/buy clusters - upgrades your nade bonus to clusters - 1000 cash',$EE81FAA1);
WriteConsole(0,'/buy nades - upgrades your cluster bonus to nades - 1000 cash',$EE81FAA1);
WriteConsole(0,'---->grenade upgrades affects whole team',$EE81FAA1);
WriteConsole(0,'/buy dex - upgrades normal death explosion size - '+inttostr(DEC)+' Cash',$EE81FAA1);
WriteConsole(0,'---->does not affect suicides',$EE81FAA1);
WriteConsole(0,'/buy holycross - Kills all zombies on Red Team score - 10000 cash',$EE81FAA1);
end;
end;
procedure OnMapChange(NewMap: string);
begin
For i := 1 to 32 do
begin
GiveBonus(i, BonusID);
end;
end;
procedure OnPlayerRespawn(ID: byte);
begin
GiveBonus(ID,BonusID);
end;
//procedure OnJoinTeam(ID, Team: byte);
//begin
//GiveBonus(ID, BonusID);
//end;
procedure OnFlagScore(ID, TeamFlag: byte);
begin
if HC = true then begin
if GetPlayerStat(ID,'Human') = true then
begin
WriteConsole(0,'Holy Cross Activated, Alpha team has scored!',$EE81FAA1);
DrawText(0,'HULELUJA!',330,RGB(255,255,255),0.20,40,240);
for i := 1 to 32 do
begin
if GetPlayerStat(i,'Human') = false then
begin
CreateBullet(GetPlayerStat(i, 'X'), GetPlayerStat(i, 'Y') - 0, 0, 0,100, 4, ID);
end;
end;
Cash:=Cash+50
WriteConsole(0,IdtoName(ID)+' earned Alpha Team 50 Cash for scoring!',$EE81FAA1);
end;
end;
end;
function OnCommand(ID: Byte; Text: string): boolean;
begin
if GetPiece(text,' ',0) = '/raisecash' then begin
Cash := Cash + Strtoint(GetPiece(Text,' ',1));
WriteConsole(0,'Admin has just deposited '+Getpiece(Text,' ',1)+' Global Player Cash!',$EE81FAA1);
end;
if Text = '/deathexplode' then begin
WriteConsole(0,'death explosions enabled', $00EE0000);
//Command('/maxrespawntime 20');
WriteLn('death explosions have been enabled by ' + IntToStr(ID) + '!');
deathexp := True;
end;
if Text = '/nodeathexp' then begin
WriteConsole(0,'death explosions disabled', $00EE0000);
//Command('/maxrespawntime 2');
WriteLn('death explosions have been disabled by ' + IntToStr(ID) + '!');
deathexp := False;
end;
end;
but when its uncommented like this it doesnt compile
Command('/setteam1 '+IntToStr(Bottoset));
ONLY THIS LINE DOES IT!!
try uncommenting this line in the code for '/buy ally' then try to compile and tell me what u find out
use your browsers search function to find it
ctrl-f
btw ive changed the var name of Botn to Bottoset
-
Delete variable Command;
-
AHHAHAHAH YOU MADE MY DAY :D thx
-
LOL oops :embarrassed:
-
btw, if ppl would answer the f**king question AS SOON AS ITS ASKED this wouldnt happen
Oi, oi, you're lucky any of us are willing to spend our time reading through your code and finding your mistakes for you. It's a privilege, not a right.
-
Oi, oi, you're lucky any of us are willing to spend our time reading through your code and finding your mistakes for you. It's a privilege, not a right.
Despite being quite agressive, I agree with you.
btw, if ppl would answer the f**king question AS SOON AS ITS ASKED this wouldnt happen
You post here to ask for help. If people doesn't want to help, they don't. Although, some of us like to help others, because we know how valuable it is.
However, it doesn't give you the right to demand for help. You simply ask for it.
Don't be unreasonable (Or w/e its spelled).
Feel free to ask, just review your concepts about "help".
-
how do i test if my raycast is working?
trying to make it so when a certain weapon was used to kill, any other enemies in range of victim have an explosive bullet spawned on them
maybe im doing something wrong
if u guys can help ill be happy :)
var
i:Byte;
x,y,x2,y2,Dist:Single;
procedure OnPlayerKill(Killer, Victim: byte; Weapon: string);
var
Wepname:String;
begin
WriteLn(IDtoName(Killer)+' has just used the: '+Weapon);
if Weapon = 'Combat Knife' then begin
for i := 1 to 32 do
x := GetPlayerStat(Victim,'x');
y := GetPlayerStat(Victim,'y');
x2 := GetPlayerStat(i,'x');
y2 := GetPlayerStat(i,'y');
if RayCast(x,y,x2,y2,Dist,800) then begin
CreateBullet(GetPlayerStat(i,'x'), GetPlayerStat(i,'y') - 0, 0, 0,100, 4, 1);
end;
end;
end;
-
That looks correct. It should work, barring possible hard to notice typos.
-
doesnt seem to be working
i added WriteLn(IDtoName(i)+' is in range of Raycast');
underneath If Raycast
the message isnt appearing in ARSSE
what do i do? i have no idea what to do here
From: April 21, 2010, 01:07:35 am
code update:var
i:Byte;
x,y,x2,y2,Dist:Single;
procedure OnPlayerKill(Killer, Victim: byte; Weapon: string);
var Wepname:String;
begin
WriteLn(IDtoName(Killer)+' has just used the: '+Weapon);
//if Weapon = 'Combat Knife' 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 - 700,Dist,3000) then begin
WriteLn(IDtoName(i)+' is in range of Raycast');
CreateBullet(GetPlayerStat(i,'x'), GetPlayerStat(i,'y') - 0, 0, 0,100, 4, 1);
end;
end;
//end;
end;
message still isnt appearing for raycast
From: April 21, 2010, 01:11:35 am
nvm, all fixed :)
-
nvm, all fixed :)
dont just "nvm" on us, what was wrong with it? The weapon name?
-
nvm, all fixed :)
dont just "nvm" on us, what was wrong with it? The weapon name?
I believe it was the RayCast() Function..
It didn't result in "True" or "False", so there should be no way to know if it was working.
-
no, actually none of the players were within range of the raycast in the if statement for it to work so it was always returning a false
where in the code i had x2,y2 - 700, ...
once i got rid of the - 700, it worked fine
heres the 2 sets of code for you to compare, ill just post the troublesome line
The Working:
if RayCast(x,y,x2,y2,Dist,3000) then begin
the Not Working and always returning False, as the Y2 coord points into the ground:
if RayCast(x,y,x2,y2 - 700,Dist,3000) then begin