/pm ignore
#1

PHP код:
if(strcmp(cmd"/pm"true) == 0)
    {
        if(
IsPlayerConnected(playerid))
        {
            if(
gPlayerLogged[playerid] == 0)
            {
                
SendClientMessage(playeridCOLOR_GREY"   You havent logged in yet!");
                return 
1;
            }
            
tmp strtok(cmdtextidx);
            if(!
strlen(tmp))
            {
                
SendClientMessage(playeridCOLOR_GRAD2"USAGE: /pm [playerid/PartOfName] [text]");
                return 
1;
            }
            
giveplayerid strval(tmp);
            if (
IsPlayerConnected(giveplayerid))
            {
                if(
giveplayerid != INVALID_PLAYER_ID)
                {
                    
GetPlayerName(giveplayeridgiveplayersizeof(giveplayer));
                    new 
length strlen(cmdtext);
                    while ((
idx length) && (cmdtext[idx] <= ' '))
                    {
                        
idx++;
                    }
                    new 
offset idx;
                    new 
result[256];
                    while ((
idx length) && ((idx offset) < (sizeof(result) - 1)))
                    {
                        
result[idx offset] = cmdtext[idx];
                        
idx++;
                    }
                    
result[idx offset] = EOS;
                    if(!
strlen(result))
                    {
                        
SendClientMessage(playeridCOLOR_GRAD2"USAGE: /pm [playerid/PartOfName] [text]");
                        return 
1;
                    }
                    
format(stringsizeof(string), "* PM from %s(ID: %d): %s"PlayerName(playerid), playerid, (result));
                    
SendClientMessage(giveplayeridCOLOR_YELLOWstring);
                    
format(stringsizeof(string), "* PM to %s(ID: %d): %s"giveplayergiveplayerid, (result));
                    
SendClientMessage(playerid,  COLOR_YELLOWstring);//to6o
                    
for(new 0MAX_PLAYERSi++)
                    {
                        if(
IsPlayerConnected(i))
                        {
                            if(
PlayerInfo[i][pAdmin] >= 1)
                            {
                                if(
PlayerInfo[i][aTog] == 1)
                                {
                                    
format(stringsizeof(string), "* PM from %s[%d] to %s[%d]: %s"PlayerName(playerid), playeridgiveplayergiveplayerid, (result));
                                    
SendClientMessage(i,  COLOR_YELLOWstring);//to6o
                                
}
                            }
                        }
                    }
                    return 
1;
                }
            }
            else
            {
                    
format(stringsizeof(string), "   %d is not an active player."giveplayerid);
                    
SendClientMessage(playeridCOLOR_GRAD1string);
            }
        }
        return 
1;
    } 
How i can make and command to stop all PM messages
Reply


Messages In This Thread
/pm ignore - by boyan96 - 19.04.2012, 18:35
Re: /pm ignore - by MeDaKewlDude - 19.04.2012, 19:38

Forum Jump:


Users browsing this thread: 1 Guest(s)