Problem with PM script
#6

This might help

PHP код:
new togglepm[MAX_PLAYERS],ID,message[128],str[128],Nam[MAX_PLAYER_NAME],Pname[MAX_PLAYER_NAME];
public 
OnPlayerConnect(playerid)
{
    
togglepm[playerid] = 1;
    return 
1;
}
CMD:pm(playeridparams[])
{
    if(
sscanf(params,"us",ID,message)) return SendClientMessage(playerid,0xF6BB0AA,"USAGE: /pm [ID] [message]");
    if(!
IsPlayerConnected(ID)) return SendClientMessage(playerid,0xFF0000FF,"Invalid ID");
    if(
togglepm[ID] == 0) return SendClientMessage(playerid,0xFB0000AA,"ERROR: That user has his pm toggled off");
    
GetPlayerName(ID,Pname,sizeof(Pname));
    
GetPlayerName(playerid,Nam,sizeof(Nam));
    
format(str,sizeof(str),">> %s(%d): %s",Pname,playerid,message);
    
SendClientMessage(playerid,0xFFFF00FF,str);
    
format(str,sizeof(str),"** %s(%d): %s",Nam,playerid,message);
    
SendClientMessage(ID,0xFFFF00FF,str);
    return 
1;
}
CMD:togglepm(playerid,params[])
{
    if(
togglepm[playerid] == 1)
    {
        
SendClientMessage(playerid,0xF6BB0AA,"You had toggled your pm OFF");
        
togglepm[playerid] = 0;
    }
    else if(
togglepm[playerid] == 0)
    {
        
SendClientMessage(playerid,0xF6BB0AA,"You had toggled your pm ON");
        
togglepm[playerid] = 1;
    }
    return 
1;

Reply


Messages In This Thread
Problem with PM script - by NickTaSpy - 24.05.2012, 14:36
Re: Problem with PM script - by Jstylezzz - 24.05.2012, 14:45
Re: Problem with PM script - by NickTaSpy - 24.05.2012, 14:49
Re: Problem with PM script - by Neil. - 24.05.2012, 14:51
Re: Problem with PM script - by NickTaSpy - 26.05.2012, 11:32
Re: Problem with PM script - by Neil. - 26.05.2012, 11:42
Re: Problem with PM script - by NickTaSpy - 26.05.2012, 20:26
Re: Problem with PM script - by Kirollos - 11.07.2012, 11:39

Forum Jump:


Users browsing this thread: 1 Guest(s)