How to fix?
#1

pawn Код:
CMD:onduty(playerid, params [])
{
    if(!IsPlayerAdmin(playerid))return SendClientMessage(playerid, COLOR_WHITE, "You are not admin!");
    {
        new name[MAX_PLAYER_NAME];
        new string[100];
        GetPlayerName(playerid, name, sizeof(name));
        format(string, sizeof(string), "Admin %s is now admin on duty!",name); return SendClientMessage(playerid, COLOR_WHITE, "You are already on duty");
        SendClientMessage(playerid, COLOR_WHITE, string);
    }
    return 1;
}
Reply
#2

How to fix what, what's the problem? Don't post a code without telling us what you want us to do, moron.
Reply
#3

Do you get errors? If so please post them
Reply
#4

I cannot get in-game that when im on duty and I do it again it doesnt sends the message "You are already on duty"
Reply
#5

pawn Код:
new OnDuty[MAX_PLAYERS];

CMD:onduty(playerid, params [])
{
    if(!IsPlayerAdmin(playerid))return SendClientMessage(playerid, COLOR_WHITE, "You are not admin!");
    if(OnDuty[playerid] == 1) return SendClientMessage(playerid, COLOR_WHITE, "You are already on duty");
    {
        new name[MAX_PLAYER_NAME];
        new string[100];
        GetPlayerName(playerid, name, sizeof(name));
        format(string, sizeof(string), "Admin %s is now admin on duty!",name);
        SendClientMessage(playerid, COLOR_WHITE, string);
        OnDuty[playerid] = 1;
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)