#1

So.. the problem is, it says: Blablabla is not accepting priv. messages , but STILL sends the message you've typed. Which it shouldnt. So just say: Blablabla is not accepting private messages, and then DONT send the message. And the IsPlayerAdmin, is to make admins able to send pms to people, even though they have nopm on. Whats wrong? Please help.

Thanks!

pawn Код:
public OnPlayerPrivmsg(playerid, recieverid, text[])
{
    new string[128];
    new Name[MAX_PLAYER_NAME+1];
   
    if(_Settings_NoPM[recieverid] == 1)
    {
      if(!IsPlayerAdmin(playerid)) {
            GetPlayerName(recieverid, Name, sizeof(Name));

            format(string, sizeof(string), "%s (%d) Is Not Accepting Private Messages At This Time.", Name, recieverid);
            SendClientMessage(playerid, 0xAA0000FF, string);
            return 0;
        }
    }
    return 1;
}
Reply
#2

For the PM to not be sent the last return should return 0 not 1
Reply
#3

Correct code.
pawn Код:
public OnPlayerPrivmsg(playerid, recieverid, text[])
{
  new string[128],Name[MAX_PLAYER_NAME+1];
  if(_Settings_NoPM[recieverid] == 1)
  {
    if(!IsPlayerAdmin(playerid))
    {
      GetPlayerName(recieverid, Name, sizeof(Name));
      format(string, sizeof(string), "%s (%d) Is Not Accepting Private Messages At This Time.", Name, recieverid);
      SendClientMessage(playerid, 0xAA0000FF, string);
      return 0;
    }
  }
  return 0;
}
Reply
#4

I see no difference at all, Rks_. You've just indented it
Reply
#5

Note the return at last.
Reply
#6

But.. this doesnt work when i put it into a FS. It DOES work when i put it into a gamemode -- wtf?
Reply
#7

Quote:
Originally Posted by Robbin237
But.. this doesnt work when i put it into a FS. It DOES work when i put it into a gamemode -- wtf?
do you have errors?
or won't it just work? ...
Reply
#8

just wont work.
Reply
#9

bump
Reply
#10

pawn Код:
public OnPlayerPrivmsg(playerid, recieverid, text[])
{
  new string[128];
  new Name[MAX_PLAYER_NAME+1];
  if(_Settings_NoPM[recieverid] == false)
  {
     format(string, sizeof(string), "%s (%d) Is Not Accepting Private Messages At This Time.", Name, recieverid);
     SendClientMessage(playerid, 0xAA0000FF, string);
     return false;
  }
  return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)