My Int Damage disallow
#1

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 ?
Reply
#2

Why don't you test it yourself?
Reply
#3

fast timer for a loop?
Reply
#4

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?
Reply
#5

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
Reply
#6

SetPlayerHealth(playerid, 99999); ?
Reply
#7

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
Reply
#8

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
Reply
#9

Quote:
Originally Posted by king_hual
Посмотреть сообщение
Aw come on ._. he still shouldn't use it right? o.o
see.. it doesnt lag at all 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
Reply
#10

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)