Posts: 108
Threads: 21
Joined: Aug 2016
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
Posts: 3,934
Threads: 353
Joined: Jan 2010
Reputation:
0
That code doesn't really tell me anything. Where's the string you're formatting?
Posts: 108
Threads: 21
Joined: Aug 2016
Onplayerdisconnect,wont they both be the same method except for the switch reason part?
Posts: 3,934
Threads: 353
Joined: Jan 2010
Reputation:
0
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?
Posts: 108
Threads: 21
Joined: Aug 2016
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?
Posts: 108
Threads: 21
Joined: Aug 2016
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
Posts: 108
Threads: 21
Joined: Aug 2016
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(playerid, string, MAX_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