Admin Duty command
#1

So i need an admin duty command when an admin types /duty it does this things:

1. Sets his skin to (id 294)
2. Sets HP to 999999
3. Sets Armour to 999999
4. Shows a text above the player saying "ADMIN"
5. A message to all players saying that that player is on duty!

Tnx in advance who helps REP +1 P.S The command it not for a RP server,its for Trucking.
Reply
#2

top of your script
Код:
new Text3D:label1[MAX_PLAYERS];
Код:
CMD:aduty(playerid, paramas[])
{
    if(adutys[playerid] == 1)
    {
		if(pInfo[playerid][Admin] >= 1)
		{
	    	SetPlayerColor(playerid, 0xAA3333AA); 
	    	SetPlayerHealth(playerid, 9999999);
	    	SetPlayerArmour(playerid, 9999999);
               SetPlayerSkin(playerid, 294);
	    	adutys[playerid] = 0;
			labeli[playerid] = Create3DTextLabel("Admin", 0x008080FF, 30.0, 40.0, 50.0, 40.0, 0);
	    	Attach3DTextLabelToPlayer(labeli[playerid], playerid, 0.0, 0.0, 0.7);
		}
		else
		SendClientMessage(playerid, 0xAA3333AA, "You must be admin to access this command!");
	}
	else
	if(adutys[playerid] == 0)
	{
			if(pInfo[playerid][Admin] >= 1)
		{
			SetPlayerColor(playerid, 0xFFFFFFAA);
	    	SetPlayerHealth(playerid, 100);
	    	SetPlayerArmour(playerid, 0);
Delete3DTextLabel(labeli[playerid]);
	    	adutys[playerid] = 1;
		}
	    else
	    SendClientMessage(playerid, 0xAA3333AA, "You must be admin to access this command!");
	}
	return 1;
}
Change admin variables to yours
Reply
#3

Quote:
Originally Posted by NexySamp
Посмотреть сообщение
So i need an admin duty command when an admin types /duty it does this things:

1. Sets his skin to (id 294)
2. Sets HP to 999999
3. Sets Armour to 999999
4. Shows a text above the player saying "ADMIN"
5. A message to all players saying that that player is on duty!

Tnx in advance who helps REP +1
Код:
    new string[100], name[MAX_PLAYER_NAME];
    if(IsPlayerAdmin(playerid))
    {
        SetPlayerHealth(playerid, 9999999);
        SetPlayerArmour(playerid, 9999999);
        SetPlayerSkin(playerid, 294);
        GetPlayerName(playerid, name, sizeof(name);
        format(string, sizeof(string), "Admin %s is on duty!", name);
        SendClientMessageToAll(-1, string);
    }
Put this in any Command.
Reply
#4

Quote:
Originally Posted by Wizzard2H
Посмотреть сообщение
top of your script
Код:
new Text3D:label1[MAX_PLAYERS];
Код:
CMD:aduty(playerid, paramas[])
{
    if(adutys[playerid] == 1)
    {
		if(pInfo[playerid][Admin] >= 1)
		{
	    	SetPlayerColor(playerid, 0xAA3333AA); 
	    	SetPlayerHealth(playerid, 9999999);
	    	SetPlayerArmour(playerid, 9999999);
               SetPlayerSkin(playerid, 294);
	    	adutys[playerid] = 0;
			labeli[playerid] = Create3DTextLabel("Admin", 0x008080FF, 30.0, 40.0, 50.0, 40.0, 0);
	    	Attach3DTextLabelToPlayer(labeli[playerid], playerid, 0.0, 0.0, 0.7);
		}
		else
		SendClientMessage(playerid, 0xAA3333AA, "You must be admin to access this command!");
	}
	else
	if(adutys[playerid] == 0)
	{
			if(pInfo[playerid][Admin] >= 1)
		{
			SetPlayerColor(playerid, 0xFFFFFFAA);
	    	SetPlayerHealth(playerid, 100);
	    	SetPlayerArmour(playerid, 0);
Delete3DTextLabel(labeli[playerid]);
	    	adutys[playerid] = 1;
		}
	    else
	    SendClientMessage(playerid, 0xAA3333AA, "You must be admin to access this command!");
	}
	return 1;
}
Change admin variables to yours
I got this error
Код:
C:\Users\Korisnik\Desktop\Yugoslavia Trucking v.0.3.7\include\PlayerCommands.inc(25) : error 017: undefined symbol "adutys"
C:\Users\Korisnik\Desktop\Yugoslavia Trucking v.0.3.7\include\PlayerCommands.inc(25) : warning 215: expression has no effect
C:\Users\Korisnik\Desktop\Yugoslavia Trucking v.0.3.7\include\PlayerCommands.inc(25) : error 001: expected token: ";", but found "]"
C:\Users\Korisnik\Desktop\Yugoslavia Trucking v.0.3.7\include\PlayerCommands.inc(25) : error 029: invalid expression, assumed zero
C:\Users\Korisnik\Desktop\Yugoslavia Trucking v.0.3.7\include\PlayerCommands.inc(25) : fatal error 107: too many error messages on one line

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


4 Errors.
P.S The cmd is not for a RP server
Reply
#5

Worked?
Reply
#6

Deagle i didnt use your code because it has no "admin is off duty" to set the normal armour,hp,Admin text etc...
Reply
#7

Код:
CMD:offduty(playerid)
{
    new string[100], name[MAX_PLAYER_NAME];
    if(IsPlayerAdmin(playerid))
    {
        SetPlayerHealth(playerid, 100);
        SetPlayerArmour(playerid, 100);
        SetPlayerSkin(playerid, 0);
        GetPlayerName(playerid, name, sizeof(name);
        format(string, sizeof(string), "Admin %s is off duty!", name);
        SendClientMessageToAll(-1, string);
    }
}
Reply
#8

I used yours
Код:
 C:\Users\Korisnik\Desktop\Yugoslavia Trucking v.0.3.7\include\PlayerCommands.inc(32) : error 001: expected token: ",", but found ";"
C:\Users\Korisnik\Desktop\Yugoslavia Trucking v.0.3.7\include\PlayerCommands.inc(46) : error 001: expected token: ",", but found ";"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Errors.
how to fix this error?
Reply
#9

Which line has errors?
Reply
#10

Quote:
Originally Posted by NexySamp
Посмотреть сообщение
I used yours
Код:
 C:\Users\Korisnik\Desktop\Yugoslavia Trucking v.0.3.7\include\PlayerCommands.inc(32) : error 001: expected token: ",", but found ";"
C:\Users\Korisnik\Desktop\Yugoslavia Trucking v.0.3.7\include\PlayerCommands.inc(46) : error 001: expected token: ",", but found ";"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Errors.
how to fix this error?
You're compiling it as include lmfao
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)