[FilterScript] Romel's Efficient and Fast Cookie System v1.0
#9

Sorry for double posting but.
I will give another way how to disable/enable the HealthEffect without editing the script.

pawn Код:
new bool:HealthEffect = true; //if its true it means on, if its false it means off.

CMD:healtheffect(playerid, params[])
{
    if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, RED, "You are not Admin!");
    if(HealthEffect == false)
    {
       format(str, sizeof(str), "Rcon Admin %s(%d) enables the Cookie Health Effect!", GetName(playerid), playerid);
       SendClientMessageToAll(YELLOW, str);
       SendClientMessage(playerid, YELLOW, "You enable the Cookie Health Effect!");
       HealthEffect = true;
    }
    else if(HealthEffect == true)
    {
       format(str, sizeof(str), "Rcon Admin %s(%d) disables the Cookie Health Effect!", GetName(playerid), playerid);
       SendClientMessageToAll(RED, str);
       SendClientMessage(playerid, YELLOW, "You disable the Cookie Health Effect!");
       HealthEffect = false;
    }
    return 1;
}
of course to make this work you have to change the /eatcookie too.

Here is the new /eatcookie created for /healtheffect

pawn Код:
CMD:eatcookie(playerid, params[])
{
    GetPlayerHealth(playerid, hp);
    if(pCookie[playerid][cookie] == 0) return SendClientMessage(playerid, RED, "You do not have cookies!");
    format(str2, sizeof(str2), "%s(%d) eat his/her cookies!", GetName(playerid), playerid);
    SendClientMessageToAll(YELLOW, str2);
    SendClientMessage(playerid, YELLOW, "Cookies eaten!, YUMMY!");
    pCookie[playerid][cookie] -= 1;
    OnePlayAnim(playerid, "FOOD", "EAT_Burger", 4.0, 0, 0, 0, 0, 0);
    if(HealthEffect == true)
    {
        SetPlayerHealth(playerid, hp + 20.0);
        SendClientMessage(playerid, -1, "Your health goes up to 20+!");
    }
    return 1;
}
Now Press CTRL + F now find for #define HealthEffect or just word HealthEffect

then delete it
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)