[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
#2

wow that is cool
Reply
#3

This is kinda wasted time and effort- you can do the same thing with RCON instagib 0/1... and that could be used easily with SendRconCommand() in a command, or with /rcon.
Reply
#4

good for rp server i think
Reply
#5

chea but I can't compile it, neither download a .AMX
Reply
#6

Quote:
Originally Posted by SAW-RL
good for rp server i think
Not really... but maybe it's good for some "DM Contests".
Reply
#7

Well, That's nice. Someone tested it?
Reply
#8

Code:
instagib 1
If you write this line to your server' cfg u have the 1 shoot = 1 death functon...

Epsilon
Reply
#9

Quote:
Originally Posted by Andre9977
Certainly very interesting indentation you got there...
Since I read your topic on indention.
Indention like that annoys the hell out of me.
Reply
#10

very, very low
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)