HideMessage
#1

Well I'm trying to hide the join/leave messages when an admin join/leaves the game but i'm facing some issues could someone tell me whats wrong?

PHP код:
    new string[70];
    switch(
reason)
    {
    case 
1: .... 
        }
     if(
Player[playerid][pAdmin] > 1) return SendClientMessageToAll(0xAAAAAAAA,string); 
What's the problem? what do i need to do
Reply
#2

That code doesn't really tell me anything. Where's the string you're formatting?
Reply
#3

Onplayerdisconnect,wont they both be the same method except for the switch reason part?
Reply
#4

Surely if you're trying to hide the join / leave messages you wouldn't send the string if an admins level is greater than 1?
Reply
#5

Quote:
Originally Posted by Luis-
Посмотреть сообщение
Surely if you're trying to hide the join / leave messages you wouldn't send the string if an admins level is greater than 1?
I didn't get the last part could you go over it if you don't mind,what i want is for example if you're an admin and u join the server players wont see your name join/leave the server but they can see players who are not admin join and leave do you understand?
Reply
#6

Maybe try something like this on OnPlayerDisconnect? If the administrator is above level 0 it wont send anything, if they aren't an administrator it'll send the message.

pawn Код:
if(PlayerInfo[playerid][pAdmin] > 0) {
    return 1;
}
else {
    SendClientMessageToAll(0xAAAAAAAA,string);
}
Reply
#7

Quote:
Originally Posted by Luis-
Посмотреть сообщение
Maybe try something like this on OnPlayerDisconnect? If the administrator is above level 0 it wont send anything, if they aren't an administrator it'll send the message.

pawn Код:
if(PlayerInfo[playerid][pAdmin] > 0) {
    return 1;
}
else {
    SendClientMessageToAll(0xAAAAAAAA,string);
}
Sure it's not return 0;? anyways thanks if it doesn't work with the return 1 i'll try the 0,thanks Luis
Reply
#8

//Edit: Oh you're right xD You wanna just show the message from users..not from admins...

PHP код:
if(!Player[playerid][pAdmin])
{
    static const 
r[3][] = {"Timeout/Crash""Quit""Kick/Ban"};
    new 
string[128];
    
GetPlayerName(playeridstringMAX_PLAYER_NAME);
    
format(string,sizeof(string),"* %s (ID: %d) has left the server. (%s)",string,playerid,r[reason]);
    
SendClientMessageToAll(0xAAAAAAAA,string);  

Reply
#9

Quote:
Originally Posted by Kaliber
Посмотреть сообщение
Just do this:

PHP код:
if(Player[playerid][pAdmin] > 1)
{
    static const 
r[3][] = {"Timeout/Crash""Quit""Kick/Ban"};
    new 
string[128];
    
GetPlayerName(playeridstringMAX_PLAYER_NAME);
    
format(string,sizeof(string),"* Admin %s (ID: %d) has left the server. (%s)",string,playerid,r[reason]);
    
SendClientMessageToAll(0xAAAAAAAA,string);  

Luis already solved it,also i didn't think you get what i said dont want players to see when admin join / leave the game
Reply
#10

Quote:
Originally Posted by CannonBolt
Посмотреть сообщение
Luis already solved it,also i didn't think you get what i said dont want players to see when admin join / leave the game
The code he wrote for you just states that only admins can see when other admins leave the game.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)