Aduty god mode
#1

Hi what it is i have this /aduty in my script
if(strcmp(cmd, "/aduty", true) == 0)
{
if(PlayerInfo[playerid][pAdmin] >= 1)
{
if(AdminDuty[playerid] == 0)
{
AdminDuty[playerid] = 1;
if(PlayerInfo[playerid][pAdmin] >= 1)
{
format(string, sizeof(string), "Server Administrator %s[%d] is now on Admin duty!", GetPlayerNameEx(playerid), playerid);
SendClientMessageToAll(COLOR_CORAL, string);
SetPlayerColor(playerid, COLOR_RED);
td[playerid] = Create3DTextLabel("[Admin Duty]",0x009999FF,0.0,0.0,0.0,40.0,1);
Attach3DTextLabelToPlayer(td[playerid],playerid, 0.0, 0.0,-0.9);
return 1;
}
but was wondering how can i make it so when on duty admin has god mode on?
Reply
#2

first of all put your code into the code tags
[ c o d e ] your code [ / c o d e ]
or [ p h p ] code [ / p h p]
without the spaces obviously
Reply
#3

PHP код:
SetPlayerHealth(playerid,999999.0); 
And when he is going out of admin duty:
PHP код:
SetPlayerHealth(playerid,100.0); 
Reply
#4

Thanks
Reply
#5

Something better that can be done is
Код:
enum pAdminGM
{
	pAdminGodmode
};
new pAdmin[playerid][pAdminGM];
if(strcmp(cmd, "/aduty", true) == 0)
{
	new string[128];
	if(PlayerInfo[playerid][pAdmin] >= 1)
	{
		format(string, sizeof(string), "Server Administrator %s[%d] is now on Admin duty!", GetPlayerNameEx(playerid), playerid);
		SendClientMessageToAll(COLOR_CORAL, string);
		SetPlayerColor(playerid, COLOR_RED);
		td[playerid] = Create3DTextLabel("[Admin Duty]",0x009999FF,0.0,0.0,0.0,40.0,1);
		Attach3DTextLabelToPlayer(td[playerid],playerid, 0.0, 0.0,-0.9);
		SetPlayerHealth(playerid,1000000);
		pAdmin[playerid][pAdminGodmode] = 1;
	}
	else if(pAdmin[playerid][pAdminGodmode] == 1)
	{
		new str[128];
		format(str,sizeof(str),"Server Administrator %s[%d] is now off Admin duty!",GetPlayernameEx(playerid),playerid);
		SetPlayerHealth(playerid,100);
		Delete3TextLabel(td);
		pAdmin[playerid][pAdminGodmode] = 0;
	}
	return 1;
}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)