[MW]CaptainPrice[DF]: [MW]CaptainPrice[DF] Test |
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;
}
enum pInfo
{
Password,
Cash,
LoggedIn,
Score,
Admin,
Operator,
Rank,
Xp,
Protected,
CapturingZone,
Connects,
Disconnects,
LoginAttempts,
Kills,
Deaths,
LastOn,
RegisterDate,
RegisterTime,
Streak,
PlayersInZone,
CDP,
Level //This one is the level number
}
new LvlName[128];
LvLName[128];
LvLName[MAX_PLAYERS][128];
LvLName[playerid] = "Whatever";
format(string, sizeof(string), "%s %s: %s", LvlName[playerid], pName, text);
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);
SendPlayerMessageToAll(playerid, string); //This should be SendClientMessageToAll, not SendPlayerMessageToAll