God mode for admin - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: God mode for admin (
/showthread.php?tid=206191)
God mode for admin -
Michael@Belgium - 03.01.2011
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 !
Re: God mode for admin -
Ironboy - 03.01.2011
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);
}
Re: God mode for admin -
Michael@Belgium - 03.01.2011
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 , ...)
Re: God mode for admin -
Ironboy - 03.01.2011
hey your command is already working
first login as a admin ,then try
Re: God mode for admin -
Michael@Belgium - 03.01.2011
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.
Re: God mode for admin -
Ironboy - 03.01.2011
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
Re: God mode for admin -
Think - 03.01.2011
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.
Re: God mode for admin -
Michael@Belgium - 03.01.2011
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 ... :-/
Re: God mode for admin -
Think - 03.01.2011
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;
}
Re: God mode for admin -
Michael@Belgium - 03.01.2011
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 ? ^^