God mode for admin
#1

I need a god mode for me at my server ...
I've tried this, but it didn't work, can you correct it ?

Код:
if(strcmp("/god", cmdtext, true) == 0)
{
	if(IsPlayerAdmin(playerid))
	{
        SetPlayerHealth(playerid, 999999999999999999999999999999999999999.0);
	}
	else
	{
	SetPlayerHealth(playerid, 100.0);
	}
}
Plz replay and fix

SOLVED !
Reply
#2

pawn Код:
dcmd_god(playerid,params[])
{
    #pragma unused params
    if(AccInfo[playerid][Level] >= 4 || IsPlayerAdmin(playerid))
    {
        if(AccInfo[playerid][God] == 0)
        {
            AccInfo[playerid][God] = 1;
            SetPlayerHealth(playerid,100000);
            GivePlayerWeapon(playerid,16,50000);
            GivePlayerWeapon(playerid,26,50000);
            SendClientMessage(playerid,green,"|- GodMod ON -|");
            return SendCommandToAdmins(playerid,"God");
            }
            else
            {
            AccInfo[playerid][God] = 0;
            SendClientMessage(playerid,red,"|- GodMod OFF -|");
            SetPlayerHealth(playerid, 100);
        }
        return GivePlayerWeapon(playerid,35,0);
    }
    else return ErrorMessages(playerid, 6);
}
Reply
#3

Quote:
Originally Posted by Ironboy
Посмотреть сообщение
pawn Код:
dcmd_god(playerid,params[])
{
    #pragma unused params
    if(AccInfo[playerid][Level] >= 4 || IsPlayerAdmin(playerid))
    {
        if(AccInfo[playerid][God] == 0)
        {
            AccInfo[playerid][God] = 1;
            SetPlayerHealth(playerid,100000);
            GivePlayerWeapon(playerid,16,50000);
            GivePlayerWeapon(playerid,26,50000);
            SendClientMessage(playerid,green,"|- GodMod ON -|");
            return SendCommandToAdmins(playerid,"God");
            }
            else
            {
            AccInfo[playerid][God] = 0;
            SendClientMessage(playerid,red,"|- GodMod OFF -|");
            SetPlayerHealth(playerid, 100);
        }
        return GivePlayerWeapon(playerid,35,0);
    }
    else return ErrorMessages(playerid, 6);
}
And what do you need above the script ? (#include , ...)
Reply
#4

hey your command is already working
first login as a admin ,then try
Reply
#5

Quote:
Originally Posted by Ironboy
Посмотреть сообщение
hey your command is already working
first login as a admin ,then try

Nope don't work, I've to compile and i get these errors:
Код:
C:\Users\Michael2\Desktop\GTA\Eigen server\gamemodes\PAT.pwn(425) : error 017: undefined symbol "dcmd_god"
C:\Users\Michael2\Desktop\GTA\Eigen server\gamemodes\PAT.pwn(427) : error 017: undefined symbol "params"
C:\Users\Michael2\Desktop\GTA\Eigen server\gamemodes\PAT.pwn(428) : error 017: undefined symbol "AccInfo"
C:\Users\Michael2\Desktop\GTA\Eigen server\gamemodes\PAT.pwn(428) : warning 215: expression has no effect
C:\Users\Michael2\Desktop\GTA\Eigen server\gamemodes\PAT.pwn(428) : error 001: expected token: ";", but found "]"
C:\Users\Michael2\Desktop\GTA\Eigen server\gamemodes\PAT.pwn(428) : error 029: invalid expression, assumed zero
C:\Users\Michael2\Desktop\GTA\Eigen server\gamemodes\PAT.pwn(428) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


6 Errors.
Reply
#6

no i mean your command.Your command is working
first you login as a admin using /rcon login password.
Then try /god it will work
Reply
#7

Quote:
Originally Posted by Ironboy
Посмотреть сообщение
pawn Код:
dcmd_god(playerid,params[])
{
    #pragma unused params
    if(AccInfo[playerid][Level] >= 4 || IsPlayerAdmin(playerid))
    {
        if(AccInfo[playerid][God] == 0)
        {
            AccInfo[playerid][God] = 1;
            SetPlayerHealth(playerid,100000);
            GivePlayerWeapon(playerid,16,50000);
            GivePlayerWeapon(playerid,26,50000);
            SendClientMessage(playerid,green,"|- GodMod ON -|");
            return SendCommandToAdmins(playerid,"God");
            }
            else
            {
            AccInfo[playerid][God] = 0;
            SendClientMessage(playerid,red,"|- GodMod OFF -|");
            SetPlayerHealth(playerid, 100);
        }
        return GivePlayerWeapon(playerid,35,0);
    }
    else return ErrorMessages(playerid, 6);
}
Copy & Paste out of your own stolen gamemode isnt going to help him.

@Michael:
Do you know what variable you use for storing your admin level, if yes post it, if no we need your script.
Reply
#8

Quote:
Originally Posted by Think
Посмотреть сообщение
Copy & Paste out of your own stolen gamemode isnt going to help him.

@Michael:
Do you know what variable you use for storing your admin level, if yes post it, if no we need your script.
Ok ... This is difficult xD. btw: I don't have a server with admin levels, im the only admin ...
Im just using rcon.

I just want a cmd (/god) for the admin himself xD

I don't understand or ... :-/
Reply
#9

Quote:
Originally Posted by Michael@Belgium
Посмотреть сообщение
Ok ... This is difficult xD. btw: I don't have a server with admin levels, im the only admin ...
Im just using rcon.

I just want a cmd (/god) for the admin himself xD

I don't understand or ... :-/
Then you should use your first code but you set the health too high

Quote:
Originally Posted by Michael@Belgium
Посмотреть сообщение
Код:
if(strcmp("/god", cmdtext, true) == 0)
{
	if(IsPlayerAdmin(playerid))
	{
        SetPlayerHealth(playerid, 999999999999999999999999999999999999999.0);
	}
	else
	{
	SetPlayerHealth(playerid, 100.0);
	}
}
use "100000" like ironboy posted with his stolen command. so;

Код:
if(strcmp("/god", cmdtext, true) == 0)
{
	if(IsPlayerAdmin(playerid))
	{
        SetPlayerHealth(playerid, 100000);
	}
	return 1;
}
Reply
#10

Quote:
Originally Posted by Think
Посмотреть сообщение
Then you should use your first code but you set the health too high



use "100000" like ironboy posted with his stolen command. so;

Код:
if(strcmp("/god", cmdtext, true) == 0)
{
	if(IsPlayerAdmin(playerid))
	{
        SetPlayerHealth(playerid, 100000);
	}
	return 1;
}
YES, it works ! TY ^^
but now i need the command /ungod or something
It it then like that:
Код:
if(strcmp("/ungod", cmdtext, true) == 0)
{
	if(IsPlayerAdmin(playerid))
	{
        SetPlayerHealth(playerid, 100);
	}
	return 1;
}
Or not ? ^^
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)