public OnPlayerText(playerid, text[])
{
if(stringContainsIP(text))
{
format(strg, sizeof(strg), ""STEELBLUE"- AS - {%06x}%s(%d) "STEELBLUE"has been automatically kicked for advertising.", (GetPlayerColor(playerid) >>> 8), GetName(playerid), playerid);
SendClientMessageToAll(-1, strg);
SendClientMessage(playerid, -1, ""RED"ERROR: "GREY"Your message has been blocked because it contains an IP. You have been kicked for advertising.");
SetTimerEx("KickPlayer", 100, false, "i", playerid);
return 0;
}
if ( PlayerInfo [ playerid ] [Admin ] == 0)
{
new String[128];
format(String, sizeof(String), "{%06x}%s: {FFFFFF}(%d): %s", (GetPlayerColor(playerid) >>> 8),GetName(playerid), playerid, text);
SendClientMessageToAll(-1,String);
return 0;
}
if ( PlayerInfo [ playerid ] [Admin ] == 1)
{
new String[128];
format(String, sizeof(String), "{996666}[ADMIN] {25A5A8}%s(%d): {FFFFFF}%s",GetName(playerid), playerid, text);
SendClientMessageToAll(-1,String);
return 0;
}
if ( PlayerInfo [ playerid ] [Admin ] == 2)
{
new String[128];
format(String, sizeof(String), "{996666}[ADMIN] {25A5A8}%s(%d): {FFFFFF}%s",GetName(playerid), playerid, text);
SendClientMessageToAll(-1,String);
return 0;
}
if ( PlayerInfo [ playerid ] [Admin ] == 3)
{
new String[128];
format(String, sizeof(String), "{996666}[ADMIN] {25A5A8}%s(%d): {FFFFFF}%s",GetName(playerid), playerid, text);
SendClientMessageToAll(-1,String);
return 0;
}
if ( PlayerInfo [ playerid ] [Admin ] == 4)
{
new String[128];
if(hide[playerid] == 0) // Put it here.. less confusing.
{
format(String, sizeof(String), "{996666}[MOD] {25A5A8}%s(%d): {FFFFFF}%s",GetName(playerid), playerid, text);
SendClientMessageToAll(-1,String);
}
else
{
format(String, sizeof(String), "{%06x}%s: {FFFFFF}(%d): %s", (GetPlayerColor(playerid) >>> 8),GetName(playerid), playerid, text);
SendClientMessageToAll(-1,String);
}
return 0;
}
if ( PlayerInfo [ playerid ] [Admin ] == 5)
{
new String[128];
if(hide[playerid] == 0) // Put it here.. less confusing.
{
format(String, sizeof(String), "{996666}[LEADER] {25A5A8}%s(%d): {FFFFFF}%s",GetName(playerid), playerid, text);
SendClientMessageToAll(-1,String);
}
else
{
format(String, sizeof(String), "{%06x}%s: {FFFFFF}(%d): %s", (GetPlayerColor(playerid) >>> 8),GetName(playerid), playerid, text);
SendClientMessageToAll(-1,String);
}
return 0;
}
if ( PlayerInfo[playerid][VIP] >= 1)
{
new String[128];
format(String, sizeof(String), "{ff7109}[DONATOR] {7c459e}%s(%d): {FFFFFF}%s",GetName(playerid), playerid, text);
SendClientMessageToAll(-1,String);
return 0;
}
if ( PlayerInfo[ playerid ][ Muted ] >= 1 )
{
new str1[60];
format( str1, sizeof(str1), ""RED"ERROR: "GREY"You are still muted for %d seconds!", PlayerInfo[ playerid ][ Muted ] );
SendClientMessage( playerid, -1, str1 );
return 0;
}
SetPlayerChatBubble(playerid, text, 0xFFFFFFFF, 35.0,7000);
if(text[0] == '#' && PlayerInfo[playerid][Admin] >= 1)
{
new string[256];
format(string,sizeof(string),"[ADMIN] %s(%d): %s",GetName(playerid),playerid,text[1]);
MessageToAdmins(COLOR_GREY,string);
return 0;
}
if(text[0] == '!' && PlayerInfo[playerid][VIP] >= 1)
{
new string[256];
format(string,sizeof(string),"[DONATOR] %s(%d): %s",GetName(playerid),playerid,text[1]);
MessageToVips(green,string);
return 0;
}
return 0;
}
Does the first one activates even if you do not type IP adress?
|
Does the first one activates even if you do not type IP adress?
|
public OnPlayerText(playerid, text[])
{
if ( PlayerInfo[ playerid ][ Muted ] >= 1 )
{
new str1[60];
format( str1, sizeof(str1), ""RED"ERROR: "GREY"You are still muted for %d seconds!", PlayerInfo[ playerid ][ Muted ] );
SendClientMessage( playerid, -1, str1 );
return 0;
}
if(stringContainsIP(text))
{
format(strg, sizeof(strg), ""STEELBLUE"- AS - {%06x}%s(%d) "STEELBLUE"has been automatically kicked for advertising.", (GetPlayerColor(playerid) >>> 8), GetName(playerid), playerid);
SendClientMessageToAll(-1, strg);
SendClientMessage(playerid, -1, ""RED"ERROR: "GREY"Your message has been blocked because it contains an IP. You have been kicked for advertising.");
SetTimerEx("KickPlayer", 100, false, "i", playerid);
return 0;
}
if ( PlayerInfo [ playerid ] [Admin ] == 0)
{
new String[128];
format(String, sizeof(String), "{%06x}%s: {FFFFFF}(%d): %s", (GetPlayerColor(playerid) >>> 8),GetName(playerid), playerid, text);
SendClientMessageToAll(-1,String);
return 0;
}
else if ( PlayerInfo [ playerid ] [Admin ] == 1)
{
new String[128];
format(String, sizeof(String), "{996666}[ADMIN] {25A5A8}%s(%d): {FFFFFF}%s",GetName(playerid), playerid, text);
SendClientMessageToAll(-1,String);
return 0;
}
else if ( PlayerInfo [ playerid ] [Admin ] == 2)
{
new String[128];
format(String, sizeof(String), "{996666}[ADMIN] {25A5A8}%s(%d): {FFFFFF}%s",GetName(playerid), playerid, text);
SendClientMessageToAll(-1,String);
return 0;
}
else if ( PlayerInfo [ playerid ] [Admin ] == 3)
{
new String[128];
format(String, sizeof(String), "{996666}[ADMIN] {25A5A8}%s(%d): {FFFFFF}%s",GetName(playerid), playerid, text);
SendClientMessageToAll(-1,String);
return 0;
}
else if ( PlayerInfo [ playerid ] [Admin ] == 4)
{
new String[128];
if(hide[playerid] == 0) // Put it here.. less confusing.
{
format(String, sizeof(String), "{996666}[MOD] {25A5A8}%s(%d): {FFFFFF}%s",GetName(playerid), playerid, text);
SendClientMessageToAll(-1,String);
}
else if(hide[playerid] == 1)
{
format(String, sizeof(String), "{%06x}%s: {FFFFFF}(%d): %s", (GetPlayerColor(playerid) >>> 8),GetName(playerid), playerid, text);
SendClientMessageToAll(-1,String);
}
return 0;
}
else if ( PlayerInfo [ playerid ] [Admin ] == 5)
{
new String[128];
if(hide[playerid] == 0) // Put it here.. less confusing.
{
format(String, sizeof(String), "{996666}[LEADER] {25A5A8}%s(%d): {FFFFFF}%s",GetName(playerid), playerid, text);
SendClientMessageToAll(-1,String);
}
else if(hide[playerid] == 1)
{
format(String, sizeof(String), "{%06x}%s: {FFFFFF}(%d): %s", (GetPlayerColor(playerid) >>> 8),GetName(playerid), playerid, text);
SendClientMessageToAll(-1,String);
}
return 0;
}
else if ( PlayerInfo[playerid][VIP] >= 1)
{
new String[128];
format(String, sizeof(String), "{ff7109}[DONATOR] {7c459e}%s(%d): {FFFFFF}%s",GetName(playerid), playerid, text);
SendClientMessageToAll(-1,String);
return 0;
}
SetPlayerChatBubble(playerid, text, 0xFFFFFFFF, 35.0,7000);
if(text[0] == '#' && PlayerInfo[playerid][Admin] >= 1)
{
new string[256];
format(string,sizeof(string),"[ADMIN] %s(%d): %s",GetName(playerid),playerid,text[1]);
MessageToAdmins(COLOR_GREY,string);
return 0;
}
if(text[0] == '!' && PlayerInfo[playerid][VIP] >= 1)
{
new string[256];
format(string,sizeof(string),"[DONATOR] %s(%d): %s",GetName(playerid),playerid,text[1]);
MessageToVips(green,string);
return 0;
}
return 0;
}
hope this will work .-.
PHP код:
|
else if ( PlayerInfo[playerid][VIP] >= 1)
{
new String[128];
format(String, sizeof(String), "{ff7109}[DONATOR] {7c459e}%s(%d): {FFFFFF}%s",GetName(playerid), playerid, text);
SendClientMessageToAll(-1,String);
return 0;
}
SetPlayerChatBubble(playerid, text, 0xFFFFFFFF, 35.0,7000);
if(text[0] == '#' && PlayerInfo[playerid][Admin] >= 1)
{
new string[256];
format(string,sizeof(string),"[ADMIN] %s(%d): %s",GetName(playerid),playerid,text[1]);
MessageToAdmins(COLOR_GREY,string);
return 0;
}
if(text[0] == '!' && PlayerInfo[playerid][VIP] >= 1)
{
new string[256];
format(string,sizeof(string),"[DONATOR] %s(%d): %s",GetName(playerid),playerid,text[1]);
MessageToVips(green,string);
return 0;
}