Command: R
#1

pawn Код:
CMD:r(playerid, params[])
{
    new string[128];
    if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
    if(!IsACop(playerid) && !IsAGov(playerid) && !IsAFIB(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You are not an SAPD/FIB Oficer/Government Official.");
    if(sscanf(params, "s[128]", params)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: (/r)adio [text]");
    if(AntiAdv(playerid, params)) return 1;
    if(PlayerInfo[playerid][pFacDiv]){format(string, sizeof(string), "** [%s] %s %s: %s", RPFDN(playerid), RPFRN(playerid), RPN(playerid), params);}
    else {format(string, sizeof(string), "** %s %s: %s", RPFRN(playerid), RPN(playerid), params);}
    SendPlayerFactionMessage(playerid, 0, COLOR_RADIO, string);
    if(IsACop(playerid)) Log("logs/SAPD.log", string);
    else if(IsAGov(playerid)) Log ("logs/GOV.log", string);
    else if(IsAFIB(playerid)) Log ("logs/FIB.log", string);
    return 1;
}]
This cmd works only for cops/gov but i need to get it working for cops goverment and FIB.
Reply
#2

Show me your SendPlayerFactionMessage function
Reply
#3

Dude it's FBI...
Reply
#4

Amm
pawn Код:
stock SendFIBMessage(color, string[])
{
    foreach(Player, i)
    {
        if(IsPlayerLoggedIn(i) && PlayerInfo[i][pFac] == 6)
        {
            SendClientMessage(i, color, string);
        }
    }
    return 1;
}
This ??
Reply
#5

Rudy_ For me it is FIB I just mess it up a litle bit, cuz i cant speak english corectly

Ahh i just neec to click on replace all
Reply
#6

Oh maybe this ??
pawn Код:
stock SendPlayerFactionMessage(playerid, rank, color, string[])
{
    foreach(Player, i)
    {
        if(IsPlayerLoggedIn(i) && PlayerInfo[i][pFac] == PlayerInfo[playerid][pFac] && PlayerInfo[i][pFacRank] >= rank)
        {
            SendClientMessage(i, color, string);
        }
    }
    return 1;
}
Reply
#7

For me, it looks fine.
Reply
#8

Mhm when i type /r when i am a cop it works fine but when i type /r when i am a FIB it says unknown command :/
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)