Help with a /pm command
#3

Quote:
Originally Posted by Fel486
Посмотреть сообщение
PHP код:
new reply[MAX_PLAYERS];
CMD:pm(playeridparams[]) 

    new 
pIDMessage[60], string[128], string2[128], aMessage[128]; 
    if(
sscanf(params"us[60]"pIDMessage)) return SendClientMessage(playerid, -1"usage :/Pm [ID] [Message]"); 
    if(
pID == INVALID_PLAYER_ID) return SendClientMessage(playerid,-1,"ID not found "); 
    
format(stringsizeof(string), "Private Message From %s (%d): %s"GetPlayerNameEx(playerid), playeridMessage); 
    
format(string2sizeof(string2), "Private Message %s (%d): %s"GetPlayerNameEx(pID), pIDMessage); 
    
SendClientMessage(playerid, -1string2); 
    
SendClientMessage(pID, -1string); 
    
PlayerPlaySound(playerid42020.00.00.0); 
    
PlayerPlaySound(pID42020.00.00.0);
    
reply[pID] = playerid;
    
format(aMessagesizeof aMessage"%s (%d) To %s (%d): %s"GetPlayerNameEx(playerid), playeridGetPlayerNameEx(pID), pIDMessage); 
    for(new 
iMAX_PLAYERSi++) 
    { 
        if(
PlayerInfo[i][pAdmin] >=|| IsPlayerAdmin(i))
        {
            if(
PlayerInfo[playerid][pAdmin] < PlayerInfo[i][pAdmin])
            {
                
SendClientMessage(i, -1aMessage); 
            }
        }
    } 
    return 
1;  
}
CMD:r(playeridparams[])  
{
    new 
pID reply[playerid], Message[60], string[128], string2[128], aMessage[128]; 
    if(
sscanf(params"s[60]"Message)) return SendClientMessage(playerid, -1"usage :/r [Message]");
    
// ... Just do the same process with pID, which was already defined on the last message player's sent.    

Another help if possible, how i can make the code like the admin who sending or reciving a pm will not see this "SendClientMessage(i, -1, aMessage); " i mean the pm which all admins will see
Reply


Messages In This Thread
Help with a /pm command - by SalmaN97 - 21.04.2015, 19:57
Re: Help with a /pm command - by Fel486 - 21.04.2015, 20:12
Re: Help with a /pm command - by SalmaN97 - 23.04.2015, 18:01
Re: Help with a /pm command - by AberKane - 23.04.2015, 18:18
Re: Help with a /pm command - by SalmaN97 - 23.04.2015, 20:32

Forum Jump:


Users browsing this thread: 1 Guest(s)