[ZCMD]Problem Showing player name went type cmd
#1

pawn Код:
CMD:onduty(playerid,params[])
{
    #pragma unused params
    if(PlayerInfo[playerid][Level] >= 1)
    {
        if(PlayerInfo[playerid][OnDuty] == 0)
        {
            PlayerInfo[playerid][OnDuty] = 1;
            return SendClientMessage(playerid,orange,"|- You are now in \"Duty Mode\" -|");
        }
        else
        {
            PlayerInfo[playerid][OnDuty] = 0;
            return SendClientMessage(playerid,orange,"|- You are now in \"Playing Mode\"-|");
        }
    }
    return SendClientMessage(playerid,red,"ERROR: You are not a high enough level to use this command");
}

Guy Cann you make my the commands went Admin preass on it say:

* Administrator John [ID:15] is now On duty.


And if he preass again is show:

* Administrator John [ID:15] is No Longer on duty.


Can you guys help ?



-Please Help +REP +REP +REP

-Regards donhu789
Reply
#2

Untested but should work:

pawn Код:
CMD:onduty(playerid,params[])
{
    #pragma unused params
    new name[24], string[128];
    GetPlayerName(playerid, name, sizeof(name));
    if(PlayerInfo[playerid][Level] >= 1)
    {
        if(PlayerInfo[playerid][OnDuty] == 0)
        {
            PlayerInfo[playerid][OnDuty] = 1;
            format(string, sizeof(string), "* Administrator %s [ID: %d] is now On duty.", name, playerid);
            SendClientMessageToAll(orange,string);
        }
        else
        {
            PlayerInfo[playerid][OnDuty] = 0;
            format(string, sizeof(string), "* Administrator %s [ID: %d] is now Off duty.", name, playerid);
            SendClientMessageToAll(orange,string);
        }
    }
    else return SendClientMessage(playerid,red,"ERROR: You are not a high enough level to use this command");
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)