SA-MP Forums Archive
[FilterScript] [FS] 1 shot - 1 death v0.1 - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+--- Thread: [FilterScript] [FS] 1 shot - 1 death v0.1 (/showthread.php?tid=32159)



[FS] 1 shot - 1 death v0.1 - ^Woozie^ - 28.03.2008

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;
}



Re: [FS] 1 shot - 1 death v0.1 - arnutisz - 28.03.2008

wow that is cool


Re: [FS] 1 shot - 1 death v0.1 - robhol - 28.03.2008

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.


Re: [FS] 1 shot - 1 death v0.1 - SAW-RL - 21.10.2008

good for rp server i think


Re: [FS] 1 shot - 1 death v0.1 - mickEi[Ro] - 09.11.2008

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


Re: [FS] 1 shot - 1 death v0.1 - DonGic4 - 09.11.2008

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


Re: [FS] 1 shot - 1 death v0.1 - MenaceX^ - 09.11.2008

Well, That's nice. Someone tested it?


Re: [FS] 1 shot - 1 death v0.1 - kisgamer - 09.11.2008

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

Epsilon


Re: [FS] 1 shot - 1 death v0.1 - Lewwy - 09.11.2008

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.


Re: [FS] 1 shot - 1 death v0.1 - Thomash - 09.11.2008

very, very low