0 Members and 2 Guests are viewing this topic.
Procedure Heal(ID: integer);beginif soldier[ID].level >=25then begin DoDamage(ID,-3);end;end; Procedure AppOnIdle(Ticks: Integer);Beginfor i:= 1 to 32 do beginHeal(i);
Procedure Heal(ID: integer);beginif soldier[ID].level >=25then begin DoDamage(ID,-3);end;end;Procedure AppOnIdle(Ticks: Integer);Beginfor i:= 1 to 32 do if GetPlayerStat(i,'Active') then beginHeal(i);
Procedure Kamikaze(ID: byte); begin if soldier[ID].level >= 40 then begin CreateBullet(GetPlayerStat(ID,'x'), GetPlayerStat(ID,'y') - 500, 0, 0,100, 4, 1); CreateBullet(GetPlayerStat(ID,'x'), GetPlayerStat(ID,'y') - 500, 1, 1,100, 4, 1); CreateBullet(GetPlayerStat(ID,'x'), GetPlayerStat(ID,'y') - 500, 2, 2,100, 4, 1); end; end;
Procedure Kamikaze(ID: byte);var X, Y: single; begin if soldier[ID].level >= 40 then begin GetPlayerXY(ID, X, Y) CreateBullet(X, Y - 10, 0, 0,100, 4, 1); CreateBullet(X, Y - 10, 1, 1,100, 4, 1); CreateBullet(X, Y - 10, 2, 2,100, 4, 1); end; end;
procedure Nuke(ID: byte); begin if GetPlayerStat(ID,'Human') = False then begin DoDamage(ID,4000); end; end;
if regExpMatch('^/(nuke)$', Text) then beginFor i := 1 to 32 do if soldier[ID].level >= 40 then begin if soldier[ID].money >= 50 then begin Nuke(i); writeconsole(0, 'NUCLEAR BOMB !', Color); end else begin writeconsole(ID, 'You are not lvl 40 + or you dont have enough money.', Color); end; end; end;
Whenever you access an ID in AppOnIdle (in general when you loop through the player list) you must check whether the ID is active (whether the ID is a player/bot on the server). if (GetPlayerStat(ID,'Active') = true) then
if regExpMatch('^/(nuke)$', Text) then beginif (soldier[ID].level >= 40) and (soldier[ID].money >= 50) then beginFor i := 1 to 32 do begin Nuke(i);WriteConsole(i, 'NUCLEAR BOMB !', Color);end; end else begin writeconsole(ID, 'You are not lvl 40 + or you dont have enough money.', Color); end; end;
Quote from: DarkCrusade on July 21, 2010, 12:56:49 pmWhenever you access an ID in AppOnIdle (in general when you loop through the player list) you must check whether the ID is active (whether the ID is a player/bot on the server). if (GetPlayerStat(ID,'Active') = true) then
procedure Nuke(ID: byte); begin if GetPlayerStat(ID,'Human') = False then begin if (GetPlayerStat(ID,'Active') = true) then begin DoDamage(ID,4000); end; end; end;
Procedure Kamikaze(ID: byte);var X, Y: single; begin if soldier[ID].level >= 40 then begin GetPlayerXY(ID, X, Y) CreateBullet(X, Y - 10, 0, 0,120, 4, 1); CreateBullet(X, Y - 10, 1, 1,120, 2, 1); CreateBullet(X, Y - 10, 2, 2,120, 9, 1); end; end;