[FilterScript] [FS] 1 shot - 1 death v0.1
#1

My new mini-FS.Only 100 lines.
If admin type in game /hpmode,all players can be killed from one shot

Download - http://www.sendspace.com/file/dbpq7k

And Here
Code:
#include <a_samp>



new HpModeA = 0;
new HpModeTimer;
new hpmodebug[MAX_PLAYERS];


forward HpMode();



public OnPlayerSpawn(playerid)
{
if(HpModeA == 1)
{
hpmodebug[playerid] = 0;
}
return 1;
}



public OnPlayerDeath(playerid, killerid, reason)
{
if(HpModeA == 1)
{
hpmodebug[playerid]=1;
}
return 1;
}



public OnPlayerCommandText(playerid, cmdtext[])
{
new cmd[256];
new idx;

cmd = strtok(cmdtext, idx);

if (strcmp(cmd, "/hpmode", true) == 0 && IsPlayerAdmin(playerid) == 1){
if(HpModeA == 1)
{
HpModeA = 0;
GameTextForPlayer(playerid, "~r~Activated", 2000, 4);
KillTimer(HpModeTimer);
}else{
HpModeA = 1;
GameTextForPlayer(playerid, "~g~Deactivated", 2000, 4);
HpModeTimer = SetTimer("HpMode",200, 1);
}
return 1;
}

return 0;
}



public HpMode()
{
new Float:h;
for(new i=0; i<MAX_PLAYERS; i++)
{
GetPlayerHealth(i,h);
if(hpmodebug[i] == 0)
{
if(h < 100)
{
SetPlayerHealth(i,0);
}
}
}
return 1;
}


strtok(const string[], &index)
{
new length = strlen(string);
while ((index < length) && (string[index] <= ' '))
{
index++;
}
new offset = index;
new result[20];
while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
{
result[index - offset] = string[index];
index++;
}
result[index - offset] = EOS;
return result;
}
Reply


Messages In This Thread
[FS] 1 shot - 1 death v0.1 - by ^Woozie^ - 28.03.2008, 18:20
Re: [FS] 1 shot - 1 death v0.1 - by arnutisz - 28.03.2008, 18:29
Re: [FS] 1 shot - 1 death v0.1 - by robhol - 28.03.2008, 19:42
Re: [FS] 1 shot - 1 death v0.1 - by SAW-RL - 21.10.2008, 22:19
Re: [FS] 1 shot - 1 death v0.1 - by mickEi[Ro] - 09.11.2008, 10:53
Re: [FS] 1 shot - 1 death v0.1 - by DonGic4 - 09.11.2008, 12:38
Re: [FS] 1 shot - 1 death v0.1 - by MenaceX^ - 09.11.2008, 13:33
Re: [FS] 1 shot - 1 death v0.1 - by kisgamer - 09.11.2008, 13:56
Re: [FS] 1 shot - 1 death v0.1 - by Lewwy - 09.11.2008, 14:02
Re: [FS] 1 shot - 1 death v0.1 - by Thomash - 09.11.2008, 14:42

Forum Jump:


Users browsing this thread: 1 Guest(s)