17.10.2014, 20:20
pawn Code:
format(string, sizeof(string), "[%d]: {ffffff}%s",playerid,text);
SendPlayerMessageToAll(playerid,string);
If i use numbers in front of the word it shows up. Why is that?
Same happens on IRC.
format(string, sizeof(string), "[%d]: {ffffff}%s",playerid,text);
SendPlayerMessageToAll(playerid,string);
public OnPlayerText(playerid, text[])
{
new pname[24];
new string[256];
GetPlayerName(playerid,pname,sizeof(pname));
if(stringContainsIP(text))
{
GetPlayerName(playerid, pname, 24);
format(string, sizeof string, "{F20056}[GUARDIAN]: {ffffff}%s[%d] has been banned from the server. {F20056}Reason: {ffffff}Server Advertise", pname,playerid);
SendClientMessageToAll(COLOR_RED, string);
Ban(playerid);
return 0;
}
//SPAM
SpamStrings[playerid] +=2;
//If Muted
if(IsMuted[playerid] == 1)
{
SendClientMessage(playerid,COLOR_YELLOW,"{990033}[SERVER]{808080}: You are muted by a Server Administrator. You cannot speak.");
return 0;
}
//If Spamming
else if(SpamStrings[playerid] >= MAX_SPAM)
{
SendClientMessage(playerid, COLOR_ERROR,"{990033}[SERVER]{808080}: Please do not spam. Please wait before typing again.");
return 0;
}
else if (text[0] == '@')
{
if(HasLawEnforcementRadio[playerid] != 1)
{
SendClientMessage(playerid,COLOR_YELLOW,"{990033}[SERVER]{808080}: You need to have a Law Enforcement radio in order to send a message down the police radio.");
return 0;
}
format(string,sizeof(string),"[POLICE RADIO]: {6699CC}%s[%d]: %s, over.",pname,playerid,text[1]);
SendClientMessageToAllCops(string);
format(string,sizeof(string),"12[POLICE RADIO] %s[%d]: %s, over.",pname,playerid,text[1]);
IRC_GroupSay(gGroupAdminID,IRC_ADMINCHANNEL,string);
return 0;
}
else if(text[0] == '!')
{
if(InGroup[playerid] != -1)
{
format(string,sizeof(string),"%s %s[%d]{FFFFFF}: %s",GetPlayerRankName(playerid),pname,playerid,text[1]);
SendGroupMessage(InGroup[playerid],string);
format(string,sizeof(string),"12[%s Chat] %s[%d]: %s",GroupInfo[InGroup[playerid]][GroupName],pname,playerid,text[1]);
IRC_GroupSay(gGroupAdminID,IRC_ADMINCHANNEL,string);
return 0;
}
}
else if(text[0] == '#')
{
if(AdminLevel[playerid] < 1) return SendClientMessage(playerid,COLOR_YELLOW,"{990033}[SERVER]{808080}: You are not allowed to use this command");
format(string,sizeof(string),"4[ADMIN CHAT] %s[%d]: %s",PlayerName(playerid),playerid,text[1]);
IRC_GroupSay(gGroupAdminID,IRC_ADMINCHANNEL,string);
for(new i=0; i<MAX_PLAYERS; i++)
{
if(AdminLevel[i] >= 1)
{
format(string,sizeof(string),"{F20056}[ADMIN CHAT]{FFFFFF}: %s[%d]: %s",PlayerName(playerid),playerid,text[1]);
SendClientMessage(i,COLOR_ADMIN,string);
}
}
return 0;
}
else if(text[0] == '$')
{
if(playerInfo[playerid][VIP] < 1) return SendClientMessage(playerid,COLOR_YELLOW,"{990033}[SERVER]{808080}: You are not allowed to use this command");
format(string,sizeof(string),"4[VIP CHAT] %s[%d]: %s",PlayerName(playerid),playerid,text[1]);
IRC_GroupSay(gGroupAdminID,IRC_ADMINCHANNEL,string);
for(new i=0; i<MAX_PLAYERS; i++)
{
if(playerInfo[playerid][VIP] >= 1)
{
format(string,sizeof(string),"{F20056}[VIP CHAT]: {FFFFFF}%s[%d]: %s",PlayerName(playerid),playerid,text[1]);
SendClientMessage(i,COLOR_ADMIN,string);
}
}
return 0;
}
else {
format(string, sizeof(string), "[%d]: {ffffff}%s",playerid,text);
SendPlayerMessageToAll(playerid,string);
//format(string, sizeof(string), "%s[%d]: {FFFFFF}%s",pname,playerid,text);
//SendPlayerMessageToAll(playerid,string);
//IRC Message
format(string,sizeof(string),"3[CHAT] %d %s[%d]:1 %s",IrcColor[playerid],pname,playerid,text);
IRC_GroupSay(gGroupID,IRC_CHANNEL,string);
}
return 0;
}