0 Members and 5 Guests are viewing this topic.
AppOnIdle(); Begin if TimerVar > 0 Then Begin DrawText(); end else if TimerVar = 0 Then Begin DrawText(); end;end;
10-04-14 21:18:32 [*] Knife Server -> [Error] (232:18): Assignment expected10-04-14 21:18:32 [*] Compilation Failed.10-04-14 21:18:32 Shutting down server...
procedure AppOnIdle(Ticks: Integer);var DC,StartTime: Byte; EngineerTimer: Integer; begin for DC := 1 to 32 do if EngineerTimer < 6 then begin if EngineerTImer < 1 then begin EngineerTimer = STARTTIME; ForceWeapon(DC,14,14,0); DrawText(DC, 'Gun removed', 120,Color,(255,255,255),5,50); end else DrawText(DC,inttostr(EngineerTimer)+' second left',180,Color,(255,255,255),5,50); end; EngineerTimer := EngineerTimer - 1; end;end;
EngineerTimer = STARTTIME;
10-04-14 21:34:09 [*] Knife Server -> [Error] (234:46): Close round expected10-04-14 21:34:09 [*] Compilation Failed.10-04-14 21:34:09 Shutting down server...
DrawText(DC,'Gun removed',120,Color,(255,255,255),5,50);
DrawText(0,'xxx',120,Color,(255,255,255),5,50);
DrawText(0,'xxx',330,RGB(255,255,255),0.20,40,240);
Procedure OnPlayerKill(Killer,Victim:byte;Weapon:string); var HP: Integer; begin if Klasse[Killer] = 'Mage' then begin GiveBonus(Killer, 4); GetPlayerStat(Killer,'Health'); <<< this is line 267 if 'Health' <> 0 = false then begin HP := 150 - 'Health'; DoDamage(Killer,HP); end; end;end;
10-04-14 22:02:39 [*] Knife Server -> [Error] (267:19): Type mismatch10-04-14 22:02:39 [*] Compilation Failed.10-04-14 22:02:39 Shutting down server...
Swompie, all good, except you dont have to use "if (TimerVar < 6) And (TimerVar > 0)"..Just go..Code: [Select]AppOnIdle(); Begin if TimerVar > 0 Then Begin DrawText(); end else if TimerVar = 0 Then Begin DrawText(); end;end;Simple like that, instead of using lots of And's..Personally, I rather using "Then if"s instead of And's.. It looks way better without the () stuffs..Oh well, it's just my opinion about it Please don't throw any rocks at me
GetPlayerStat(Killer,'Health');
@ JFK: are you sure that modulus business with ticks is right? How can you get 5, 4, 3, 2 or 1 when ticks is always a multiple of 60? Oo
WriteConsole(ID,MyInteger,$FFFFFF);
WriteConsole(ID,IntToStr(MyInteger),$FFFFFF);
To do something each second, you have to use "If Ticks Mod 60 = 0"..If you use "If Ticks Mod (60 * 5) = 0", it will execute the function inside it, every FIVE seconds.
if 'Health' <> 0 = false then begin
Procedure AppOnIdle(Ticks: Integer); var DC, StartTime: Byte;begin for DC := 1 to 32 do if GetPlayerStat(DC, 'Active') = true then if GetPlayerStat(DC, 'Alive') = true then if Klasse[DC] = 'Engineer' then if GetPlayerStat(DC, 'Primary') <> 11 = false then if ticks mod (60 * 7) = 0 then ForceWeapon(DC,14,255,0);end;
Procedure AppOnIdle(Ticks: Integer); var DC, StartTime: Byte;begin for DC := 1 to 32 do if GetPlayerStat(DC, 'Active') = true then if GetPlayerStat(DC, 'Alive') = true then if Klasse[DC] = 'Engineer' then if GetPlayerStat(DC, 'Primary') <> 11 = false then //rethink this line if ticks mod (60 * 7) = 0 then ForceWeapon(DC,14,255,0);end;