28.03.2020, 10:01
hello,
it's been almost 1 week since i modified joining/leaving/dm chating messages (from default messages to some kind of admin rank messages if player's an admin, etc.) and the problem is that the "RCON" one doesn't show up in any joining/leaving/dm chating messages. I've tried simpler ways to fix it, it still stays the same no matter what. here are the 3 codes i've made, joining/leaving/dm chating:
this is on OnPlayerConnect:
this one is on OnPlayerDisconnect:
and this one is on OnPlayerText but it gets triggered only when a player's on a deathmatch arena:
and in case you want to know the default messaging: (also on OnPlayerText)
any help's appreciated, i don't know if 1 of these can fix all the other 2 (except from the default texting)
p.s: the default messaging is below the dm chating one, just to let you know
it's been almost 1 week since i modified joining/leaving/dm chating messages (from default messages to some kind of admin rank messages if player's an admin, etc.) and the problem is that the "RCON" one doesn't show up in any joining/leaving/dm chating messages. I've tried simpler ways to fix it, it still stays the same no matter what. here are the 3 codes i've made, joining/leaving/dm chating:
this is on OnPlayerConnect:
pawn Code:
if(PlayerInfo[playerid][AdminLevel] > 0)
{
if(IsPlayerAdmin(playerid))
{
admrank = "{FF0000}[RCON Admin]";
}
else
{
switch(PlayerInfo[playerid][AdminLevel])
{
case 1: admrank = "{FFFF00}[Moderator]";
case 2: admrank = "{008000}[Administrator]";
case 3: admrank = "{3366FF}[Manager]";
}
}
format(string, sizeof(string), "{A9A9A9}[{00FF00}+{A9A9A9}]{00FF00} %s {FFFFFF}%s (%d) {00FF00}has joined the server!", admrank, pname, playerid);
SendClientMessageToAll(COLOR_LIME, string);
}
else
{
format(string, sizeof(string), "{A9A9A9}[{00FF00}+{A9A9A9}]{FFFFFF} %s (%d) {00FF00}has joined the server!", pname, playerid);
SendClientMessageToAll(COLOR_LIME, string);
}
}
else
{
format(string, sizeof(string), "{FFFFFF}Welcome, the account \"{FF0000}%s{FFFFFF}\" is not registered.\nIn order to play, you must register by typing a password below.", pname);
ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, "{FF0000}Registration", string, "Okay", "Quit");
format(string, sizeof(string), "{A9A9A9}[{00FF00}+{A9A9A9}]{00FF00} \"{FFFFFF}%s{00FF00}\" (%d) has joined the server for the first time!", pname, playerid);
}
return 1;
}
pawn Code:
if(PlayerInfo[playerid][AdminLevel] > 0)
{
if(IsPlayerAdmin(playerid))
{
admrank = "{FF0000}[RCON Admin]";
}
else
{
switch(PlayerInfo[playerid][AdminLevel])
{
case 1: admrank = "{FFFF00}[Moderator]";
case 2: admrank = "{008000}[Administrator]";
case 3: admrank = "{3366FF}[Manager]";
}
}
switch(reason)
{
case 0: format(string,sizeof(string),"{A9A9A9}[{FF0000}-{A9A9A9}] %s{FFFFFF} %s (%d) {FF0000}has left the server. (Timeout/Crash)",admrank, pname, playerid);
case 1: format(string,sizeof(string),"{A9A9A9}[{FF0000}-{A9A9A9}] %s{FFFFFF} %s (%d) {FF0000}has left the server. (Leaving)",admrank, pname, playerid);
case 2: format(string,sizeof(string),"{A9A9A9}[{FF0000}-{A9A9A9}] %s{FFFFFF} %s (%d) {FF0000}has left the server. (Kicked/Banned)",admrank, pname, playerid);
}
}
else
{
switch(reason)
{
case 0: format(string,sizeof(string),"{A9A9A9}[{FF0000}-{A9A9A9}]{FFFFFF} %s (%d) {FF0000}has left the server. (Timeout/Crash)",pname, playerid);
case 1: format(string,sizeof(string),"{A9A9A9}[{FF0000}-{A9A9A9}]{FFFFFF} %s (%d) {FF0000}has left the server. (Leaving)",pname, playerid);
case 2: format(string,sizeof(string),"{A9A9A9}[{FF0000}-{A9A9A9}]{FFFFFF} %s (%d) {FF0000}has left the server. (Kicked/Banned)",pname, playerid);
}
}
SendClientMessageToAll(COLOR_LIME, string);
pawn Code:
if(dm[playerid] == 1)
{
if(PlayerInfo[playerid][AdminLevel] > 0)
{
if(IsPlayerAdmin(playerid))
{
switch(dm[playerid])
{
case 0:
{
format(string,sizeof(string),"{800080}[DDM] [RCON] %s(%d): %s", pname, playerid, text);
SendClientMessageToAll(COLOR_PURPLE, string);
return 0;
}
case 1:
{
format(string,sizeof(string),"{800080}[SDM] [RCON] %s(%d): %s",pname, playerid, text);
SendClientMessageToAll(COLOR_PURPLE, string);
return 0;
}
case 2:
{
format(string,sizeof(string),"{800080}[SOSDM] [RCON] %s(%d): %s",pname, playerid, text);
SendClientMessageToAll(COLOR_PURPLE, string);
return 0;
}
}
}
else
{
switch(PlayerInfo[playerid][AdminLevel])
{
case 1: admrank = "[Moderator]";
case 2: admrank = "[Administrator]";
case 3: admrank = "[Manager]";
}
}
switch(dm[playerid])
{
case 0:
{
format(string,sizeof(string),"{800080}[DDM] %s %s(%d): %s",admrank, pname, playerid, text);
SendClientMessageToAll(COLOR_PURPLE, string);
return 0;
}
case 1:
{
format(string,sizeof(string),"{800080}[SDM] %s %s(%d): %s",admrank, pname, playerid, text);
SendClientMessageToAll(COLOR_PURPLE, string);
return 0;
}
case 2:
{
format(string,sizeof(string),"{800080}[SOSDM] %s %s(%d): %s",admrank, pname, playerid, text);
SendClientMessageToAll(COLOR_PURPLE, string);
return 0;
}
}
}
else
{
switch(dm[playerid])
{
case 0:
{
format(string,sizeof(string),"%s(%d): %s",pname, playerid, text);
SendClientMessageToAll(COLOR_PURPLE, string);
return 0;
}
case 1:
{
format(string,sizeof(string),"%s(%d): %s",pname, playerid, text);
SendClientMessageToAll(COLOR_PURPLE, string);
return 0;
}
case 2:
{
format(string,sizeof(string),"%s(%d): %s",pname, playerid, text);
SendClientMessageToAll(COLOR_PURPLE, string);
return 0;
}
}
}
}
pawn Code:
if(IsPlayerAdmin(playerid))
{
format(string, sizeof(string), "[RCON] {FFFFFF}%s(%d): %s", pname, playerid, text);
SendClientMessageToAll(COLOR_RCON, string);
return 0;
}
if(PlayerInfo[playerid][AdminLevel] < 1)
{
format(string, sizeof(string), "%s(%d): %s", pname, playerid, text);
SendClientMessageToAll(COLOR_WHITE, string);
return 0;
}
if(PlayerInfo[playerid][AdminLevel] == 1)
{
format(string, sizeof(string), "[Moderator] {FFFFFF}%s(%d): %s", pname, playerid, text);
SendClientMessageToAll(COLOR_YELLOW, string);
return 0;
}
if(PlayerInfo[playerid][AdminLevel] == 2)
{
format(string, sizeof(string), "[Administrator] {FFFFFF}%s(%d): %s", pname, playerid, text);
SendClientMessageToAll(COLOR_ADMINISTRATOR, string);
return 0;
}
if(PlayerInfo[playerid][AdminLevel] == 3)
{
format(string, sizeof(string), "[Manager] {FFFFFF}%s(%d): %s", pname, playerid, text);
SendClientMessageToAll(COLOR_MANAGER, string);
return 0;
}
return 1;
}
p.s: the default messaging is below the dm chating one, just to let you know