03.09.2012, 00:51
Title speaks for itself. How is it possible?
pawn Код:
public OnPlayerText(playerid, text[])
{
new textstring[128];
new ircMsg[256];
if(PlayerInfo[playerid][pMuted] == true)
{
SendClientMessage(playerid, -1, "SERVER: You can't talk while muted.");
return 0;
}
if( text[0] == '!')
{
// Echo the formatted message
format(ircMsg, sizeof(ircMsg), "9,4*** %s (ID: %i) to IRC: %s", GetName(playerid), playerid, text[1]);
IRC_GroupSay(groupID, IRC_CHANNEL, ircMsg);
format(ircMsg, sizeof(ircMsg), "Your message '%s' has been sent to IRC.", text[1]);
SendClientMessage(playerid, 0x0000FFFF, ircMsg);
return 0;
}
format(ircMsg, sizeof(ircMsg), "02[%d] 07%s: %s", playerid, GetName(playerid), text);
IRC_GroupSay(groupID, IRC_CHANNEL, ircMsg);
if( text[0] == '#' && PlayerInfo[playerid][pAdmin] == 1)
{
new Message[128];
format( Message, sizeof Message, "{00B2EE}[ADMIN CHAT] %s (ID: %i | LVL: %i): %s", GetName(playerid), playerid, PlayerInfo[playerid][pAdmin], text[1] );
SendAdminMessage(1, -1, Message);
return 0;
}
else if( text[0] == '#' && PlayerInfo[playerid][pAdmin] == 2 )
{
new Message[128];
format( Message, sizeof Message, "{00EE76}[ADMIN CHAT] %s (ID: %i | LVL: %i): %s", GetName(playerid), playerid, PlayerInfo[playerid][pAdmin], text[1] );
SendAdminMessage(1, -1, Message);
return 0;
}
else if( text[0] == '#' && PlayerInfo[playerid][pAdmin] == 3 )
{
new Message[128];
format( Message, sizeof Message, "{EEEE00}[ADMIN CHAT] %s (ID: %i | LVL: %i): %s", GetName(playerid), playerid, PlayerInfo[playerid][pAdmin], text[1] );
SendAdminMessage(1, -1, Message);
return 0;
}
else if( text[0] == '#' && PlayerInfo[playerid][pAdmin] == 4 )
{
new Message[128];
format( Message, sizeof Message, "{FF0000}[ADMIN CHAT] %s (ID: %i | LVL: %i): %s", GetName(playerid), playerid, PlayerInfo[playerid][pAdmin], text[1] );
SendAdminMessage(1, -1, Message);
return 0;
}
else if( text[0] == '#' && PlayerInfo[playerid][pAdmin] >= 5 )
{
new Message[128];
format( Message, sizeof Message, "{FF7F00}[ADMIN CHAT] %s (ID: %i | LVL: %i): %s", GetName(playerid), playerid, PlayerInfo[playerid][pAdmin], text[1] );
SendAdminMessage(1, -1, Message);
return 0;
}
if( text[0] == '@' && PlayerInfo[playerid][pVip] == 1 )
{
new Message[128];
format( Message, sizeof Message, "{C0C0C0}[VIP CHAT] %s (ID: %i | LVL: %i): %s", GetName(playerid), playerid, PlayerInfo[playerid][pVip], text[1] );
SendVIPMessage(1, -2, Message);
return 0;
}
else if( text[0] == '@' && PlayerInfo[playerid][pVip] == 2 )
{
new Message[128];
format( Message, sizeof Message, "{C0C0C0}[VIP CHAT] %s (ID: %i | LVL: %i): %s", GetName(playerid), playerid, PlayerInfo[playerid][pVip], text[1] );
SendVIPMessage(1, -2, Message);
return 0;
}
else if( text[0] == '@' && PlayerInfo[playerid][pVip] == 3 )
{
new Message[128];
format( Message, sizeof Message, "{FFD700}[VIP CHAT] %s (ID: %i | LVL: %i): %s", GetName(playerid), playerid, PlayerInfo[playerid][pVip], text[1] );
SendVIPMessage(1, -2, Message);
return 0;
}
return 1;
}