SA-MP Forums Archive
Admin chat help - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Server (https://sampforum.blast.hk/forumdisplay.php?fid=6)
+--- Forum: Server Support (https://sampforum.blast.hk/forumdisplay.php?fid=19)
+--- Thread: Admin chat help (/showthread.php?tid=419944)



Admin chat help - arathin - 02.03.2013

Alright guys so heres the deal when a player join and selects a team his team color is fine but even him being a normal players makes him have the [Admin][playername]: prefix I dont get it if someone could take a look at the code Id love it.


Код:
if(PlayerInfo[playerid][pAdmin] >= 1)
    if(gTeam[playerid] == TEAM_MEXICANS)
    {
        new pName[MAX_PLAYER_NAME], String[175];
        GetPlayerName(playerid, pName, 24);
        format(String, sizeof(String), "{FFFFFF}[{99FF00}Admin{FFFFFF}] {F5E618}%s:{FFFFFF} %s", pName, text);
        SendClientMessageToAll(-1,String);
        return 0;
    }
    if(PlayerInfo[playerid][pAdmin] >= 1)
    if(gTeam[playerid] == TEAM_BIKER)
    {
        new pName[MAX_PLAYER_NAME], String[175];
        GetPlayerName(playerid, pName, 24);
        format(String, sizeof(String), "{FFFFFF}[{99FF00}Admin{FFFFFF}] {BFC0C2}%s:{FFFFFF} %s", pName, text);
        SendClientMessageToAll(-1,String);
        return 0;
	}
	if(PlayerInfo[playerid][pAdmin] >= 1)
	if(gTeam[playerid] == TEAM_MAFIA)
    {
        new pName[MAX_PLAYER_NAME], String[175];
        GetPlayerName(playerid, pName, 24);
        format(String, sizeof(String), "{FFFFFF}[{99FF00}Admin{FFFFFF}] {800080}%s:{FFFFFF} %s", pName, text);
        SendClientMessageToAll(-1,String);
        return 0;
	}
	if(PlayerInfo[playerid][pAdmin] >= 1)
	if(gTeam[playerid] == TEAM_YAKUZA)
    {
        new pName[MAX_PLAYER_NAME], String[175];
        GetPlayerName(playerid, pName, 24);
        format(String, sizeof(String), "{FFFFFF}[{99FF00}Admin{FFFFFF}] {AA3333}%s:{FFFFFF} %s", pName, text);
        SendClientMessageToAll(-1,String);
        return 0;
	}
	if(PlayerInfo[playerid][pAdmin] >= 1)
	if(gTeam[playerid] == TEAM_HOMELESS)
    {
        new pName[MAX_PLAYER_NAME], String[175];
        GetPlayerName(playerid, pName, 24);
        format(String, sizeof(String), "{FFFFFF}[{99FF00}Admin{FFFFFF}] {33AA33}%s:{FFFFFF} %s", pName, text);
        SendClientMessageToAll(-1,String);
        return 0;
	}



Re: Admin chat help - roar - 03.03.2013

Код:
if(PlayerInfo[playerid][pAdmin] >= 1)
{
    if(gTeam[playerid] == TEAM_MEXICANS)
    {
        new pName[MAX_PLAYER_NAME], String[175];
        GetPlayerName(playerid, pName, 24);
        format(String, sizeof(String), "{FFFFFF}[{99FF00}Admin{FFFFFF}] {F5E618}%s:{FFFFFF} %s", pName, text);
        SendClientMessageToAll(-1,String);
        return 1;
    }    
    if(gTeam[playerid] == TEAM_BIKER)
    {
        new pName[MAX_PLAYER_NAME], String[175];
        GetPlayerName(playerid, pName, 24);
        format(String, sizeof(String), "{FFFFFF}[{99FF00}Admin{FFFFFF}] {BFC0C2}%s:{FFFFFF} %s", pName, text);
        SendClientMessageToAll(-1,String);
        return 1;
    }
    if(gTeam[playerid] == TEAM_MAFIA)
    {
        new pName[MAX_PLAYER_NAME], String[175];
        GetPlayerName(playerid, pName, 24);
        format(String, sizeof(String), "{FFFFFF}[{99FF00}Admin{FFFFFF}] {800080}%s:{FFFFFF} %s", pName, text);
        SendClientMessageToAll(-1,String);
        return 1;
    }
     if(gTeam[playerid] == TEAM_YAKUZA)
    {
        new pName[MAX_PLAYER_NAME], String[175];
        GetPlayerName(playerid, pName, 24);
        format(String, sizeof(String), "{FFFFFF}[{99FF00}Admin{FFFFFF}] {AA3333}%s:{FFFFFF} %s", pName, text);
        SendClientMessageToAll(-1,String);
        return 1;
    }
    if(gTeam[playerid] == TEAM_HOMELESS)
    {
        new pName[MAX_PLAYER_NAME], String[175];
        GetPlayerName(playerid, pName, 24);
        format(String, sizeof(String), "{FFFFFF}[{99FF00}Admin{FFFFFF}] {33AA33}%s:{FFFFFF} %s", pName, text);
        SendClientMessageToAll(-1,String);
        return 1;
    }
}
Try that?


Re: Admin chat help - YesYesYes - 03.03.2013

I guess the problem is here, in these codes
pawn Код:
if(PlayerInfo[playerid][pAdmin] >= 1)
    if(gTeam[playerid] == TEAM_YAKUZA)
it should be
pawn Код:
if(PlayerInfo[playerid][pAdmin] >= 1 && gTeam[playerid] == TEAM_YAKUZA)
{
       //then further function
}
use "&&" to indicate if Player is admin AND he chooses some team,,, I guess this would help


Re: Admin chat help - arathin - 03.03.2013

Thanks fixed it but problem wasn't either of what you guys did I had to move it into the same FS and the rest of my commands lol it works now though so REP to you guys


Re: Admin chat help - roar - 03.03.2013

Glad the problem is fixed!