Admin Chat -
Loinal - 22.05.2016
in game when i join it say
Example:
Martex [0][Admin: 10]: test
Martex [0]: test
i want if player admin only use the first one
and normal player the second one
Codes here:
PHP код:
if(User[playerid][accountAdmin] > 1)
{
new stringbig[213];
format(stringbig,sizeof(stringbig),"%s [Admin: %d][%d]: {FF0000}%s",pName(playerid),User[playerid][accountAdmin],playerid, text);
SendClientMessageToAll(playerid,stringbig);
}
else
{
new stringbig[213];
format(stringbig,sizeof(stringbig),"[%d]: {FFFFFF}%s",playerid, text);
SendPlayerMessageToAll(playerid,stringbig);
}
Re: Admin Chat -
AliBro - 22.05.2016
not confirm but try this
Codes here:
PHP код:
if(User[playerid][accountAdmin] > 1)
{
new stringbig[213];
format(stringbig,sizeof(stringbig),"%s [Admin: %d][%d]: {FF0000}%s",pName(playerid),User[playerid][accountAdmin],playerid, text);
SendClientMessageToAll(playerid,stringbig);
}
if(User[playerid][accountAdmin] > 0)
else
{
new stringbig[213];
format(stringbig,sizeof(stringbig),"[%d]: {FFFFFF}%s",playerid, text);
SendPlayerMessageToAll(playerid,stringbig);
}
Re: Admin Chat -
BornHuman - 22.05.2016
Here's what I would do:
pawn Код:
new stringbig[213];
switch(User[playerid][accountAdmin]) // Use a 'switch' statement to get the variable.
{
case 0: format(stringbig, sizeof(stringbig), "%s [Admin: %d][%d]: {FF0000}%s", pName(playerid), User[playerid][accountAdmin], playerid, text); // If their accountAdmin variable is 0
default: format(stringbig, sizeof(stringbig), "[%d]: {FFFFFF}%s", playerid, text); // If their accountAdmin variable is anything but 0.
}
SendPlayerMessageToAll(-1, stringbig);
Re: Admin Chat -
Luicy. - 22.05.2016
PHP код:
if(User[playerid][accountAdmin] > 1)
{
new stringbig[213];
format(stringbig,sizeof(stringbig),"%s [Admin: %d][%d]: {FF0000}%s",pName(playerid),User[playerid][accountAdmin],playerid, text);
SendClientMessageToAll(-1,stringbig);
}
else
{
new stringbig[213];
format(stringbig,sizeof(stringbig),"[%d]: {FFFFFF}%s",playerid, text);
SendPlayerMessageToAll(-1,stringbig);
}
Re: Admin Chat -
CSLangdale - 22.05.2016
Код:
stock GetAdminRank(playerid)
{
new arank[64];
switch(pInfo[playerid][Admin])
{
case 99999: arank = "Community Owner";
case 99998: arank = "Co-Community Owner";
case 1337: arank = "Management";
case 4: arank = "Head Admin";
case 3: arank = "General Admin";
case 2: arank = "Junior Admin";
case 1: arank = "Server Moderator";
case 0: arank = "Player";
}
return arank;
}
add this then in the chat line just do this
Код:
format(stringbig,sizeof(stringbig),"%s %s: {FF0000}%s",pName(playerid), GetAdminRank(playerid),User[playerid],playerid, text);
SendClientMessageToAll(playerid,stringbig)
put them in your own order though ofcourse which ever way round you want them
Re: Admin Chat -
CSLangdale - 22.05.2016
you would only need them to lines you wouldnt need to put them more than once
Re: Admin Chat -
Xdrime - 23.05.2016
Код:
if(text[0] == '#' && pInfo[playerid][Admin] >= 1)
{
format(strg, sizeof(strg), "(Admin Chat) %s: %s", GetName(playerid), text[1]);
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(pInfo[i][Admin] >= 1)
{
SendClientMessage(i, 0xFF00DD, strg);
}
}
}
return 0;
}
that's what i used for my admin chat
sorry if it didnt help
Re: Admin Chat -
AjaxM - 23.05.2016
PHP код:
if(User[playerid][accountAdmin] > 1)
{
new stringbig[213];
format(stringbig,sizeof(stringbig),"%s [Admin: %d][%d]: {FF0000}%s",pName(playerid),User[playerid][accountAdmin],playerid, text);
SendClientMessageToAll(playerid,stringbig);
}
Only this one is required since if the player is a normal player, it'll auto-trigger the second text.