HideMessage - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: HideMessage (
/showthread.php?tid=617483)
HideMessage -
CannonBolt - 22.09.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
Re: HideMessage -
Luis- - 22.09.2016
That code doesn't really tell me anything. Where's the string you're formatting?
Re: HideMessage -
CannonBolt - 22.09.2016
Onplayerdisconnect,wont they both be the same method except for the switch reason part?
Re: HideMessage -
Luis- - 22.09.2016
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?
Re: HideMessage -
CannonBolt - 22.09.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?
Re: HideMessage -
Luis- - 22.09.2016
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);
}
Re: HideMessage -
CannonBolt - 22.09.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
Re: HideMessage -
Kaliber - 22.09.2016
//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(playerid, string, MAX_PLAYER_NAME);
format(string,sizeof(string),"* %s (ID: %d) has left the server. (%s)",string,playerid,r[reason]);
SendClientMessageToAll(0xAAAAAAAA,string);
}
Re: HideMessage -
CannonBolt - 22.09.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
Re: HideMessage -
InActtive™ - 22.09.2016
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.