A PM system which Admins can also see(not RCON)
#3

Also mine is like that if you use ZCMD/IZCMD:
PHP код:
CMD:pm(playeridparams[])
{
    new 
cible,
        
message[95];

    if(
sscanf(params,"us[95]"ciblemessage)) return SCM(playeridLBLUE"/pm [player_id/name] [message]");
    if(!
IsPlayerConnected(cible))
        return 
ErrorMsg(playerid_"This player is not connected");

    new 
temp PmTime[playerid] - gettime();
    if(
PmTime[playerid] && PmTime[playerid] > gettime())
        
ErrorMsg(playerid_"You must wait %s sec before sending an another PM."temp);

    
PmTime[playerid] = gettime() + TPS_PM;
    
SCMF(playerid0xffdd99ff"[PM] Send to %s : %s"GetName(cibletrue), message);
    
SCMF(cible0xffc34dff"[PM] Recivied from %s : %s"GetName(playeridtrue), message);
    
SendMessageToAdmins(SAUMON"[Admin] %s » %s : '%s'"GetName(playeridtrue), GetName(cibletrue), message);
    return 
1;

Include y_va from YSI is required for this following functions.
PHP код:
SCMF(const playeridcouleur, const msg[], va_args<>)
{
    new
        
string[145];

    
va_format(stringsizeof(string), msgva_start<3>);
    return 
SendClientMessage(playeridcouleurstring);
}

ErrorMsg(playeridallowed true, const msg[] = EOSva_args<>)
{
    new 
message[190];
    static const 
premsg[] = "[Erreur] %s";

    if(!
allowed)
        return 
SCMF(playeridREDF"[Error] You are not allowed to use this command.");

    if(
numargs() == 2)
        return 
SCMF(playeridREDFpremsgmsg);

    
va_format(messagesizeof(message), msgva_start<3>);

    return 
SCMF(playeridREDF"[Erreur] %s"message);
}
GetName(const playeridid false)
{
    static 
str[MAX_PLAYER_NAME+9];
    
GetPlayerName(playeridstrsizeof(str));
    if(
idformat(strsizeof(str), "%s (ID: %i)"strplayerid);
    return 
str;
}
SendMessageToAdmins(color, const msg[], va_args<>)
{
    new
        
string1[190];

    
va_format(string1sizeof(string1), msgva_start<2>);

    foreach(new 
Player)
    {
        if(
pAccount[i][pAdmin] < 1) continue;
        
SCM(icolorstring1);
    }

    return 
1;

Reply


Messages In This Thread
A PM system which Admins can also see(not RCON) - by Gotham - 29.09.2016, 12:22
Re: A PM system which Admins can also see(not RCON) - by Adarsh007 - 29.09.2016, 12:24
Re: A PM system which Admins can also see(not RCON) - by Dayrion - 29.09.2016, 12:48

Forum Jump:


Users browsing this thread: 1 Guest(s)