0 Members and 1 Guest are viewing this topic.
// Buys a specified item Procedure Buy(ID:Byte; Money,Item:Integer); begin if Item > 0 then begin if Item < 16 then begin if Money >= Price[Item] then begin Player[ID].Money := Player[ID].Money - Price[Item]; case Item of 1,2,3,4,5,6,7,8,9,10: begin ForceWeapon(ID,Item,GetPlayerStat(ID,'Primary'),0); SetWeaponActive(ID,Item,true); Player[ID].Weapon[Item] := true; end; 11: DoDamage(ID,GetPlayerStat(ID,'Health') - 150); 12: GiveBonus(ID,4); 13: GiveBonus(ID,1); 14: GiveBonus(ID,2); 15: if GetPlayerStat(ID,'Ground') = true then begin Player[ID].Turret := SpawnObject(GetPlayerStat(ID,'X'),GetPlayerStat(ID,'Y'),Item); WriteConsole(ID,'You can move your turret by !moveturret', White); end else WriteConsole(ID,'You must be standing on the ground to buy a turret.', Red); 16: if not Player[ID].Zombie then begin Player[ID].Lives := Player[ID].Lives + 1; WriteConsole(ID,'You feel stronger..', Orange); end else WriteConsole(ID,'You are already a zombie.', Red); 17: if Player[ID].Zombie then begin Player[ID].Zombie := false; SetTeam(ID,1); WriteConsole(ID,'You feel.. good! You just raised from the dead!', Orange); end else WriteConsole(ID,'You are not infected.', Red); end; end else WriteConsole(ID,'You don''t have enough money.', Red); end else WriteConsole(ID,'Invalid item ID.', Red); end else WriteConsole(ID,'Invalid item ID.', Red); end;
Type Stats = Record Zombie,Weapon:Boolean; Money,Turret,Lives:Integer; Klasse: Byte; // 0: human 1: zombie 2: gunner 3: knifer 4: tankend;var Player: Array[1..32] of Stats;
@mich: It'll be a remix of the good'ol (!KY) ZombieSurvival, the best zombie server ever imo
Type Stats = Record Zombie: Boolean; Money, Turret, Lives: Integer; Weapon: Array[0..16] of Boolean;end;Var Player: Array[1..32] of Stats;//In use:Player[ID].Weapon[10] := True; //Should enable MinigunPlayer[ID].Weapon[14] := False; //Disables Combat KnifePlayer[ID].Weapon[16] := True; //Enables LAW, and there it goes.//If you wanna use Stationarys too, go "Weapon: Array[0..17] of Boolean;".. 17 would be Stat.//Good luck :)//Hope I've helped :]
It was so basic that I didn't see it.. thanks guys (excluding Swompie )
10-05-30 03:36:16 [*] [Error] Test(Mine) -> (OnPlayerSpeak): Could not call proc
const White = $FFFFFF; Orange = $FF7F24; Red = $EE3B3B; MineDuration = 180; // Time in seconds the mine lasts MaxMines = 5; // Maximum amount of mines / map MineRange = 45; // Range of mines (14 units = 1 meter) MineM79 = 1; // MineXYZ increases the created bullets exponentially (MineM79 > MineGren > MineClux) MineGren = 2; MineClux = 3;Type MineStats = Record X,Y:Single; Time:Integer;end;Type GeneralStats = Record MineStat: Array of MineStats;end;var Mine: Array[1..32] of GeneralStats; NumMines: Byte;Procedure DetonateMine(ID,Enemy:Byte; X,Y:Single);var i,ii,iii:Byte; R1,R2:Integer; begin for i := 1 to MineM79 do begin R1 := Round(Random(-200,201) / 150); R2 := Round(Random(100,326) / 150); CreateBullet(X,Y,R1,R2,100,4,ID); for ii := 1 to MineGren do begin R1 := Round(Random(-250,251) / 125); R2 := Round(Random(100,381) / 125); CreateBullet(X,Y,R1,R2,100,2,ID); for iii := 1 to MineClux do begin R1 := Round(Random(-350,351) / 115); R2 := Round(Random(100,501) / 115); CreateBullet(X,Y,R1,R2,100,10,ID); end; end; end; WriteConsole(Enemy,'You stepped into a claymore.', Red); WriteConsole(ID,IDToName(Enemy) + ' has stepped on one of your mines.', Orange); NumMines := NumMines - 1; end; Procedure CallMines();var i,ii,iii,All:Byte; Dist:Single; begin for i := 1 to 32 do if GetPlayerStat(i,'Active') = true then begin All := GetArrayLength(Mine[i].MineStat); for ii := 1 to All do begin for iii := 1 to 32 do if GetPlayerStat(iii,'Active') = true then if GetPlayerStat(iii,'Alive') = true then if (GetPlayerStat(iii,'Team') <> GetPlayerStat(i,'Team')) OR (GetPlayerStat(i,'Team') = 0) then begin Dist := Distance(Mine[i].MineStat[ii].X,Mine[i].MineStat[ii].Y,GetPlayerStat(iii,'X'),GetPlayerStat(iii,'Y')); if Dist <= MineRange then DetonateMine(i,iii,Mine[i].Minestat[ii].X,Mine[i].MineStat[ii].Y); end; if Mine[i].MineStat[ii].Time <> - 1 then begin Mine[i].MineStat[ii].Time := Mine[i].MineStat[ii].Time - 1; CreateBullet(Mine[i].MineStat[ii].X,Mine[i].MineStat[ii].Y,0,0,0,7,i); if Mine[i].MineStat[ii].Time = 0 then begin WriteConsole(i,'One of your mines exceeds it''s duration and blows up.', Orange); DetonateMine(i,iii,Mine[i].MineStat[ii].X,Mine[i].MineStat[ii].Y); Mine[i].MineStat[ii].Time := - 1; end; end; end; end; end; Procedure PlaceMine(ID:Byte);var ArrLength:Byte; begin if NumMines < MaxMines then begin if GetPlayerStat(ID,'Alive') = true then begin if GetPlayerStat(ID,'Ground') = true then begin ArrLength := GetArrayLength(Mine[ID].MineStat); SetArrayLength(Mine,ArrLength + 1); Mine[ID].MineStat[ArrLength].X := GetPlayerStat(ID,'X'); Mine[ID].MineStat[ArrLength].Y := GetPlayerStat(ID,'Y'); Mine[ID].MineStat[ArrLength].Time := MineDuration; NumMines := NumMines + 1; WriteConsole(ID,'You have laid a mine successfully.', White); end else WriteConsole(ID,'You must be standing on the ground.', Red); end else WriteConsole(ID,'You must be alive to use skills.', Red); end else WriteConsole(ID,'There are already ' + inttostr(MaxMines) + ' mines on the map.', Red); end; Procedure DestroyAllMines();var i:Byte; begin for i := 1 to 32 do if GetPlayerStat(i,'Active') = true then SetArrayLength(Mine[i].MineStat,0); end; Procedure OnPlayerSpeak(ID:Byte; Text:String); begin case LowerCase(Text) of '!mine','!test': PlaceMine(ID); '!blowup','!blow': DestroyAllMines(); end; end; Procedure AppOnIdle(Ticks:Integer); begin CallMines(); end; Procedure OnMapChange(NewMap:String); begin DestroyAllMines(); end;