My Int Damage disallow - 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: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: My Int Damage disallow (
/showthread.php?tid=296583)
My Int Damage disallow -
spd_sahil - 12.11.2011
pawn Код:
SetTimer("dmgdisable",10,true);
pawn Код:
forward dmgdisable();
public dmgdisable()
{
for(new i;i<MAX_PLAYERS;i++)
{
if(IsPlayerConnected(i))
{
if(GetPlayerInterior(i)>0)
{
GetPlayerHealth(i,hp[i]);
GetPlayerArmour(i,ar[i]);
ch12[i] = 1;
invins();
}
else ch12[i] = 0;
}
}
}
forward invins();
public invins()
{
for(new i;i<MAX_PLAYERS;i++)
{
if(IsPlayerConnected(i))
{
if(ch12[i] == 1)
{
SetPlayerHealth(i,hp[i]);
SetPlayerArmour(i,ar[i]);
}
}
}
}
How efficient do you think this is ?? how well do you think this will workk ?
Re: My Int Damage disallow -
GangsTa_ - 12.11.2011
Why don't you test it yourself?
Re: My Int Damage disallow -
iJumbo - 12.11.2011
fast timer for a loop?
Re: My Int Damage disallow -
KingHual - 12.11.2011
Well that sucks to be honest. A loop will probably take more time to be executed than the value of the timer which means LAG amiright?
Re: My Int Damage disallow -
spd_sahil - 12.11.2011
Well , the thing is.. i tested it.. its good against guns.. but nades screw you.. im a newbie.. idk what else i can do to stop nades from killing people
Re: My Int Damage disallow -
KingHual - 12.11.2011
SetPlayerHealth(playerid, 99999); ?
Re: My Int Damage disallow -
KingHual - 12.11.2011
Quote:
Originally Posted by ******
Not really, no. You would need a VERY slow loop for it to take over 10ms (or a VERY slow PC, the sort that could not even run the server).
|
Aw come on ._. he still shouldn't use it right? o.o
Re: My Int Damage disallow -
sleepysnowflake - 12.11.2011
Well he can optimize it a bit. The max players in your server is not 500 right ?
You can just do this:
pawn Код:
#if defined MAX_PLAYERS
#undef MAX_PLAYERS
#define MAX_PLAYERS YOURMAXPLAYERSHERE
#endif
Re: My Int Damage disallow -
spd_sahil - 12.11.2011
Quote:
Originally Posted by king_hual
Aw come on ._. he still shouldn't use it right? o.o
|
see.. it doesnt lag at all
![Tongue](images/smilies/razz.gif)
cause what im running is a private server , so gun shots never kill u indoors.. only the nades do that . anyways im not using this now, im just storing health and armor in a float array and giving god mode in interiors.. and setting them back when interior == 0
Re: My Int Damage disallow -
spd_sahil - 12.11.2011
no the thing is.. i have an NPC indoor whose using a weapon.. so if i disable.. i havent tried.. but he might lose his weapon