0 Members and 1 Guest are viewing this topic.
// Health Regeneration Script v1.2 by Avkon// This script automatically replenishes lost health of all players at a specified pace.// Declare a couple of essential values:const MAX_HEALTH = 150; // Set to 150 for non-realistic mode, else set to 65. DROP_VALUE = 5; // Value of each 'drop' of health, def: 5.// Incorporate main health regen code into AppOnIdle procedure:procedure AppOnIdle(Ticks: integer);var i: byte;begin if Ticks mod (60 * 1) = 0 then begin for i := 1 to 32 do if (GetPlayerStat(i,'Health') < (MAX_HEALTH - (DROP_VALUE - 1))) then begin DoDamage(i,-DROP_VALUE); end else begin DoDamage(i,-(MAX_HEALTH - (GetPlayerStat(i,'Health')))); end; end;end;// Inform players of health regen modification:procedure OnJoinTeam(ID, Team: byte);begin SayToPlayer(ID, 'This server runs the following mod:'); SayToPlayer(ID, '! Health Regeneration Script v1.2 (by Avkon)');end;
MAX_HEALTH = 150; // Set to 150 for non-realistic mode, else set to 65. DROP_VALUE = 5; // Value of each 'drop' of health, def: 5.
Hmm... Would this be good for an awesome Halo Mod? Say... SHIELD!?!?!
My new password is secure as shit Mate, I am not sure Shit is even secured nowadays.
// Incorporate main health regen code into AppOnIdle procedure:procedure AppOnIdle(Ticks: integer);var i: byte;begin if Ticks mod (60 * 1) = 0 then begin i := NameToID("Player Name"); if (GetPlayerStat(i,'Health') < (MAX_HEALTH - (DROP_VALUE - 1))) then begin DoDamage(i,-DROP_VALUE); end else begin DoDamage(i,-(MAX_HEALTH - (GetPlayerStat(i,'Health')))); end;end;
i := NameToID("Player Name");
i := NameToID("miketh2005");
How do I get it to work so only 1 player can say a command like !medic and only they can get this and if 1 person is already medic then it says $PLAYER_NAME is already your medic!
AlphaMedicID := 3; //somewhere in your code to establish who is medic (for alpha team)BravoMedicID := 5; //for bravo team*procedure HealTeam(Team: byte);var c: byte;begin for c := 1 to 32 do if (GetPlayerStat(c,'Active') = 1) and (GetPlayerStat(c,'Team') = Team) then DoDamage(c, GetPlayerStat(c,'Health') - 150); // use 65 instead of 150 for Realisticend;procedure OnPlayerCommand(ID, Text)begin Ltext := LowerCase(Text); //makes it so commands are not case sensitive if Ltext = '/heal' then begin if ID = AlphaMedicID then HealTeam(1); //calls up HealTeam function - 1 means Alpha else if ID = BravoMedicID then HealTeam(2); //same as above line for team 2 (bravo) else WriteConsole(ID, iif(GetPlayerStat(ID, 'Team') = 1, GetPlayerStat(AlphaMedicID,'Name'), GetPlayerStat(BravoMedicID,'Name')) + ' is your team-medic', $B0FF4000);end;