#8

Quote:
Originally Posted by Arthur Kane
Посмотреть сообщение
Try this:

PHP код:
CMD:aod(playeridparams[])
{
    if(
playerData[playerid][playerLoggedIn])
    {
        if(
playerData[playerid][playerLevel] >= 1)
        {
            if(!
playerData[playerid][playerAdminDuty])
            {
                    new 
string[128];
                
SendClientMessage(playeridCOLOR_WHITE"{OOFFOO}[ADMIN]{FFFFFF} You're now an on duty Administrator.");
                
playerData[playerid][playerAdminDuty] = true;
                
playerData[playerid][playerAdminLabel] = Create3DTextLabel("Admin on Duty"0x00ff00ff30.040.050.060.0, -11);
                
Attach3DTextLabelToPlayer(playerData[playerid][playerAdminLabel], playerid0.00.00.4);
                
                
//Sends message to everybody
                
format(stringsizeof(string), "{00FF00}[ADMIN] {FF69A6}%s is now an on duty Administrator. Use /ask!"playerData[playerid][tempAdminName]);
                
SendClientMessageToAll(COLOR_WHITEstring);
                
// Give them infinite health.
                
SetPlayerHealth(playerid9999999);
                
SetPlayerColor(playerid0x00ff00);
                
TextDrawShowForPlayer(playeridText:AdminDuty);
            }
            else
            {
                
// Admin is already on duty, so we'll now put them off duty
                
SendClientMessage(playeridCOLOR_WHITE"{00FF00}[ADMIN] {FFFFFF}You're now an off duty Administrator.");
                
playerData[playerid][playerAdminDuty] = false;
                
Delete3DTextLabel(playerData[playerid][playerAdminLabel]);
                
// Give them default health
                
SetPlayerHealth(playerid100);
                
newPlayerColour(playerid);
                
TextDrawHideForPlayer(playeridText:AdminDuty);
                
                
//Sends message to everybody
                
format(stringsizeof(string), "{00FF00}[ADMIN] {FF69A6}%s is now an off duty Administrator."playerData[playerid][tempAdminName]);
                
SendClientMessageToAll(COLOR_WHITEstring);
            }
        }
        else
        {
            
SendClientMessage(playeridCOLOR_WHITE"{B7B7B7}[SERVER]{FFFFFF} You're not an admin.");
        }
    }
    return 
1;

PHP код:
                //Sends message to everybody 
                
format(stringsizeof(string), "{00FF00}[ADMIN] {FF69A6}%s is now an off duty Administrator."playerData[playerid][tempAdminName]); 
                
SendClientMessageToAll(COLOR_WHITEstring); 
This will return an error due to not defining "string". (The formatted string after else).
Reply


Messages In This Thread
CMD - by KNIGHT786 - 26.03.2017, 18:30
Re: CMD - by GoldenLion - 26.03.2017, 18:31
Re: CMD - by KNIGHT786 - 26.03.2017, 18:41
Re: CMD - by Unte99 - 26.03.2017, 19:30
Re: CMD - by TopShooter2 - 26.03.2017, 20:17
Re: CMD - by Variable™ - 26.03.2017, 20:44
Re: CMD - by Kane - 26.03.2017, 21:37
Re: CMD - by Variable™ - 26.03.2017, 21:58
Re: CMD - by TopShooter2 - 26.03.2017, 22:35
Re: CMD - by KNIGHT786 - 27.03.2017, 08:42

Forum Jump:


Users browsing this thread: 2 Guest(s)