Admin rights!
#14

This is the right way to make a god command;

pawn Код:
//At top
#include <zcmd> //Credits to Zeex

new HasGod[MAX_PLAYERS];

public OnPlayerConnect(playerid) //This is a callback
{
    HasGod[playerid] = 0;
    return 1;
}
//Otside ANY callback
CMD:god(playerid, params[])
{
    if(IsPlayerAdmin(playerid))
    {
        if(HasGod[playerid] == 0)
        {
            HasGod[playerid] = 1;
            SendClientMessage(playerid, -1, "God mode turned on!");
        }
        else if(HasGod[playerid] == 1)
        {
            HasGod[playerid] = 0;
            SendClientMessage(playerid, -1, "God mode turned off!");
        }
    }
    else return SendClientMessage(playerid, -1, "You are not an admin");
    return 1;
}

public OnPlayerUpdate(playerid) //this is a callback
{
    if(HasGod[playerid] == 1)
    {
        SetTimer("SetHealth", 100, true);
    }
    return 1;
}

forward SetHealth(playerid);
public SetHealth(playerid) //this is a callback
{
    SetPlayerHealth(playerid, 100);
    return 1;
}
You have to download Zcmd include and put it into [yourserver name]/pawno/includes.
Reply


Messages In This Thread
Admin rights! - by samtey - 30.07.2011, 08:28
Re: Admin rights! - by Kush - 30.07.2011, 08:37
AW: Admin rights! - by samtey - 30.07.2011, 08:47
Re: Admin rights! - by Markx - 30.07.2011, 08:52
Re: Admin rights! - by Kush - 30.07.2011, 08:53
Re: Admin rights! - by Max_Coldheart - 30.07.2011, 08:55
AW: Admin rights! - by samtey - 30.07.2011, 08:56
Re: Admin rights! - by Double-O-Seven - 30.07.2011, 08:57
Re: Admin rights! - by Max_Coldheart - 30.07.2011, 09:00
Re: Admin rights! - by Kush - 30.07.2011, 09:00
Re: Admin rights! - by Max_Coldheart - 30.07.2011, 09:04
AW: Admin rights! - by samtey - 30.07.2011, 09:07
Re: AW: Admin rights! - by Kush - 30.07.2011, 09:12
Re: Admin rights! - by Markx - 30.07.2011, 09:19
AW: Admin rights! - by samtey - 30.07.2011, 09:19
Re: AW: Admin rights! - by Kush - 30.07.2011, 09:37
Re: AW: Admin rights! - by Markx - 30.07.2011, 10:08
AW: Re: AW: Admin rights! - by samtey - 30.07.2011, 10:22
Re: AW: Admin rights! - by Kush - 30.07.2011, 15:08

Forum Jump:


Users browsing this thread: 5 Guest(s)