KillTimer not work
#1

hello i created filterscripts called " health hack "
it works but i can't off it


header

pawn Код:
#include <a_samp>

new endhack[MAX_PLAYERS];
#pragma tabsize 0
This Is Error

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/cchackon", cmdtext, true) == 0)
    {
        endhack[playerid] = SetTimerEx("SetPlayerHealth70", 100, false, "i", playerid);
        return 1;
    }
     if (strcmp("/cchackoff", cmdtext, true) == 0)
    {
        KillTimer(endhack[playerid]);
        return 1;
    }
    return 0;
}
How To Make The Random Health (Health Hack)

pawn Код:
forward SetPlayerHealth70(playerid);
public SetPlayerHealth70(playerid)
{
    SetPlayerHealth(playerid, 70);
    SetPlayerArmour(playerid, 70);
    SetTimerEx("SetPlayerHealth50", 100, false, "i", playerid);
    return 1;
}
forward SetPlayerHealth50(playerid);
public SetPlayerHealth50(playerid)
{
    SetPlayerHealth(playerid, 50);
    SetPlayerArmour(playerid, 50);
    SetTimerEx("SetPlayerHealth20", 100, false, "i", playerid);
    return 1;
}
forward SetPlayerHealth20(playerid);
public SetPlayerHealth20(playerid)
{
    SetPlayerHealth(playerid, 20);
    SetTimerEx("SetPlayerHealth100", 100, false, "i", playerid);
    SetPlayerArmour(playerid, 20);
    return 1;
}

forward SetPlayerHealth100(playerid);
public SetPlayerHealth100(playerid)
{
    SetPlayerArmour(playerid, 100);
    SetPlayerHealth(playerid, 100);
    SetTimerEx("SetPlayerHealth70", 100, false, "i", playerid);
    return 1;
}
Reply
#2

help ??
Reply
#3

Inside your functions you need to declare the variable endhack to the timer once again because another timer is created.
Reply
#4

THat is a fairly un-optimized way of creating a Health Hack... Just activate a variable called HealthHack then do this

pawn Код:
OnPlayerTakeDamage()
if(HealthHack == 1)
{
    SetPlayerHealth(playerid, 99999):
}
return 1;
}
Reply
#5

Quote:
Originally Posted by SuperViper
Посмотреть сообщение
[...] you need to re-assign the variable [...]
Declaration is when you use new, static, stock infront of the variable names to add it to your script
Assignment is when you use symbols like =, +=, -=.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)