20.01.2013, 16:42
Hello Again,
In my OnPlayerText, i try to add a rank before the name, but it just says:
Here is my OnPlayerText (You just want the top part, not the VIP or Admin chat):
Any help?
In my OnPlayerText, i try to add a rank before the name, but it just says:
Quote:
[MW]CaptainPrice[DF]: [MW]CaptainPrice[DF] Test |
pawn Код:
public OnPlayerText(playerid, text[])
{
new string[100];
new pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, sizeof(pName));
new year,month,day;
new hour,minute,second;
getdate(year,month,day);
gettime(hour,minute,second);
format(string, sizeof(string), "%s %s: %s", LvlName, pName, text); //Just this part
SendPlayerMessageToAll(playerid, string); //And this part
//Bot
if(strfind(text,"noob bot",true) != -1)
{
SendClientMessageToAll(COLOR_GREEN, "[BOT]WarBot: I'm not the noob, you are.");
}
if(strfind(text,"hi bot",true) != -1)
{
SendClientMessageToAll(COLOR_GREEN, "[BOT]WarBot: Hey man!");
}
if(strfind(text,"ban the bot",true) != -1)
{
SendClientMessageToAll(COLOR_GREEN, "[BOT]WarBot: Why do you want me banned?");
}
//Admin Chat
if(PlayerInfo[playerid][Admin] >= 1 && text[0] == '#')
{
format(string, sizeof(string),"(Admin Chat) %s(%d): %s", pName, playerid, text[1]);
MessageToAdmins(COLOR_GREEN, string);
format(string, sizeof(string),"[Date: %d/%d/%d][Time: %d:%d:%d] %s(%d): %s\n", year, month, day, hour, minute, second, pName, playerid, text[1]);
SaveIn("AdminChat", string);
}
//VIP Chat
if(PlayerInfo[playerid][Rank] >= 1 && text[0] == '^')
{
format(string, sizeof(string),"(VIP Chat) %s(%d): %s\n", pName, playerid, text[1]);
MessageToVIPs(0x465300D7, string);
format(string, sizeof(string),"[Date: %d/%d/%d][Time: %d:%d:%d] %s(%d): %s", year, month, day, hour, minute, second, pName, playerid, text[1]);
SaveIn("VipChat", string);
}
return 0;
}