OnPlayerText
#1

Hi All,
i have Question How to fix Onplayertext bcz not full OnPlayertext Work Only in the top Help me to fix it
Code pawno
PHP код:
public OnPlayerText(playeridtext[])
{
    if(
stringContainsIP(text))
    {
        
format(strgsizeof(strg), ""STEELBLUE"- AS - {%06x}%s(%d) "STEELBLUE"has been automatically kicked for advertising.", (GetPlayerColor(playerid) >>> 8), GetName(playerid), playerid);
        
SendClientMessageToAll(-1strg);
        
SendClientMessage(playerid, -1""RED"ERROR: "GREY"Your message has been blocked because it contains an IP. You have been kicked for advertising.");
        
SetTimerEx("KickPlayer"100false"i"playerid);
        return 
0;
    }
    if ( 
PlayerInfo playerid ] [Admin ] == 0)
    {
        new 
String[128];
        
format(Stringsizeof(String), "{%06x}%s: {FFFFFF}(%d): %s", (GetPlayerColor(playerid) >>> 8),GetName(playerid), playeridtext);
        
SendClientMessageToAll(-1,String);
        return 
0;
    }
    if ( 
PlayerInfo playerid ] [Admin ] == 1)
    {
        new 
String[128];
        
format(Stringsizeof(String), "{996666}[ADMIN] {25A5A8}%s(%d): {FFFFFF}%s",GetName(playerid), playeridtext);
        
SendClientMessageToAll(-1,String);
        return 
0;
    }
    if ( 
PlayerInfo playerid ] [Admin ] == 2)
    {
        new 
String[128];
        
format(Stringsizeof(String), "{996666}[ADMIN] {25A5A8}%s(%d): {FFFFFF}%s",GetName(playerid), playeridtext);
        
SendClientMessageToAll(-1,String);
        return 
0;
    }
    if ( 
PlayerInfo playerid ] [Admin ] == 3)
    {
        new 
String[128];
        
format(Stringsizeof(String), "{996666}[ADMIN] {25A5A8}%s(%d): {FFFFFF}%s",GetName(playerid), playeridtext);
        
SendClientMessageToAll(-1,String);
        return 
0;
    }
    if ( 
PlayerInfo playerid ] [Admin ] == 4)
    {
      new 
String[128];
      if(
hide[playerid] == 0// Put it here.. less confusing.
      
{
        
format(Stringsizeof(String), "{996666}[MOD] {25A5A8}%s(%d): {FFFFFF}%s",GetName(playerid), playeridtext);
        
SendClientMessageToAll(-1,String);
      }
      else
      {
      
format(Stringsizeof(String), "{%06x}%s: {FFFFFF}(%d): %s", (GetPlayerColor(playerid) >>> 8),GetName(playerid), playeridtext);
      
SendClientMessageToAll(-1,String);
      }
      return 
0;
    }
    if ( 
PlayerInfo playerid ] [Admin ] == 5)
    {
      new 
String[128];
      if(
hide[playerid] == 0// Put it here.. less confusing.
      
{
        
format(Stringsizeof(String), "{996666}[LEADER] {25A5A8}%s(%d): {FFFFFF}%s",GetName(playerid), playeridtext);
        
SendClientMessageToAll(-1,String);
      }
      else
      {
      
format(Stringsizeof(String), "{%06x}%s: {FFFFFF}(%d): %s", (GetPlayerColor(playerid) >>> 8),GetName(playerid), playeridtext);
      
SendClientMessageToAll(-1,String);
      }
      return 
0;
    }
    if ( 
PlayerInfo[playerid][VIP] >= 1)
    {
        new 
String[128];
        
format(Stringsizeof(String), "{ff7109}[DONATOR] {7c459e}%s(%d): {FFFFFF}%s",GetName(playerid), playeridtext);
        
SendClientMessageToAll(-1,String);
        return 
0;
    }
    if ( 
PlayerInfoplayerid ][ Muted ] >= )
    {
        new 
str1[60];
        
formatstr1sizeof(str1), ""RED"ERROR: "GREY"You are still muted for %d seconds!"PlayerInfoplayerid ][ Muted ] );
        
SendClientMessageplayerid, -1str1 );
        return 
0;
    }
    
SetPlayerChatBubble(playeridtext0xFFFFFFFF35.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;
 } 
+rep if you help me
Reply
#2

Try make every if except the first one to "else if"
Reply
#3

Still Don't Work
Reply
#4

Does the first one activates even if you do not type IP adress?
Reply
#5

Quote:
Originally Posted by thefirestate
Посмотреть сообщение
Does the first one activates even if you do not type IP adress?
What U Mean?
Reply
#6

I mean, if you type "Hello" , would you get the message telling you that your cannot type IP adress.
Reply
#7

Quote:
Originally Posted by thefirestate
Посмотреть сообщение
Does the first one activates even if you do not type IP adress?
What U Mean?
Reply
#8

Bump!
Reply
#9

hope this will work .-.
PHP код:
public OnPlayerText(playeridtext[])
{
    if ( 
PlayerInfoplayerid ][ Muted ] >= )
    {
        new 
str1[60];
        
formatstr1sizeof(str1), ""RED"ERROR: "GREY"You are still muted for %d seconds!"PlayerInfoplayerid ][ Muted ] );
        
SendClientMessageplayerid, -1str1 );
        return 
0;
    }
    if(
stringContainsIP(text))
    {
        
format(strgsizeof(strg), ""STEELBLUE"- AS - {%06x}%s(%d) "STEELBLUE"has been automatically kicked for advertising.", (GetPlayerColor(playerid) >>> 8), GetName(playerid), playerid);
        
SendClientMessageToAll(-1strg);
        
SendClientMessage(playerid, -1""RED"ERROR: "GREY"Your message has been blocked because it contains an IP. You have been kicked for advertising.");
        
SetTimerEx("KickPlayer"100false"i"playerid);
        return 
0;
    }
    if ( 
PlayerInfo playerid ] [Admin ] == 0)
    {
        new 
String[128];
        
format(Stringsizeof(String), "{%06x}%s: {FFFFFF}(%d): %s", (GetPlayerColor(playerid) >>> 8),GetName(playerid), playeridtext);
        
SendClientMessageToAll(-1,String);
        return 
0;
    }
    else if ( 
PlayerInfo playerid ] [Admin ] == 1)
    {
        new 
String[128];
        
format(Stringsizeof(String), "{996666}[ADMIN] {25A5A8}%s(%d): {FFFFFF}%s",GetName(playerid), playeridtext);
        
SendClientMessageToAll(-1,String);
        return 
0;
    }
    else if ( 
PlayerInfo playerid ] [Admin ] == 2)
    {
        new 
String[128];
        
format(Stringsizeof(String), "{996666}[ADMIN] {25A5A8}%s(%d): {FFFFFF}%s",GetName(playerid), playeridtext);
        
SendClientMessageToAll(-1,String);
        return 
0;
    }
    else if ( 
PlayerInfo playerid ] [Admin ] == 3)
    {
        new 
String[128];
        
format(Stringsizeof(String), "{996666}[ADMIN] {25A5A8}%s(%d): {FFFFFF}%s",GetName(playerid), playeridtext);
        
SendClientMessageToAll(-1,String);
        return 
0;
    }
    else if ( 
PlayerInfo playerid ] [Admin ] == 4)
    {
      new 
String[128];
      if(
hide[playerid] == 0// Put it here.. less confusing.
      
{
        
format(Stringsizeof(String), "{996666}[MOD] {25A5A8}%s(%d): {FFFFFF}%s",GetName(playerid), playeridtext);
        
SendClientMessageToAll(-1,String);
      }
      else if(
hide[playerid] == 1)
      {
      
format(Stringsizeof(String), "{%06x}%s: {FFFFFF}(%d): %s", (GetPlayerColor(playerid) >>> 8),GetName(playerid), playeridtext);
      
SendClientMessageToAll(-1,String);
      }
      return 
0;
    }
    else if ( 
PlayerInfo playerid ] [Admin ] == 5)
    {
      new 
String[128];
      if(
hide[playerid] == 0// Put it here.. less confusing.
      
{
        
format(Stringsizeof(String), "{996666}[LEADER] {25A5A8}%s(%d): {FFFFFF}%s",GetName(playerid), playeridtext);
        
SendClientMessageToAll(-1,String);
      }
      else if(
hide[playerid] == 1)
      {
      
format(Stringsizeof(String), "{%06x}%s: {FFFFFF}(%d): %s", (GetPlayerColor(playerid) >>> 8),GetName(playerid), playeridtext);
      
SendClientMessageToAll(-1,String);
      }
      return 
0;
    }
    else if ( 
PlayerInfo[playerid][VIP] >= 1)
    {
        new 
String[128];
        
format(Stringsizeof(String), "{ff7109}[DONATOR] {7c459e}%s(%d): {FFFFFF}%s",GetName(playerid), playeridtext);
        
SendClientMessageToAll(-1,String);
        return 
0;
    }
    
SetPlayerChatBubble(playeridtext0xFFFFFFFF35.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;
 } 
Reply
#10

Quote:
Originally Posted by jlalt
Посмотреть сообщение
hope this will work .-.
PHP код:
public OnPlayerText(playeridtext[])
{
    if ( 
PlayerInfoplayerid ][ Muted ] >= )
    {
        new 
str1[60];
        
formatstr1sizeof(str1), ""RED"ERROR: "GREY"You are still muted for %d seconds!"PlayerInfoplayerid ][ Muted ] );
        
SendClientMessageplayerid, -1str1 );
        return 
0;
    }
    if(
stringContainsIP(text))
    {
        
format(strgsizeof(strg), ""STEELBLUE"- AS - {%06x}%s(%d) "STEELBLUE"has been automatically kicked for advertising.", (GetPlayerColor(playerid) >>> 8), GetName(playerid), playerid);
        
SendClientMessageToAll(-1strg);
        
SendClientMessage(playerid, -1""RED"ERROR: "GREY"Your message has been blocked because it contains an IP. You have been kicked for advertising.");
        
SetTimerEx("KickPlayer"100false"i"playerid);
        return 
0;
    }
    if ( 
PlayerInfo playerid ] [Admin ] == 0)
    {
        new 
String[128];
        
format(Stringsizeof(String), "{%06x}%s: {FFFFFF}(%d): %s", (GetPlayerColor(playerid) >>> 8),GetName(playerid), playeridtext);
        
SendClientMessageToAll(-1,String);
        return 
0;
    }
    else if ( 
PlayerInfo playerid ] [Admin ] == 1)
    {
        new 
String[128];
        
format(Stringsizeof(String), "{996666}[ADMIN] {25A5A8}%s(%d): {FFFFFF}%s",GetName(playerid), playeridtext);
        
SendClientMessageToAll(-1,String);
        return 
0;
    }
    else if ( 
PlayerInfo playerid ] [Admin ] == 2)
    {
        new 
String[128];
        
format(Stringsizeof(String), "{996666}[ADMIN] {25A5A8}%s(%d): {FFFFFF}%s",GetName(playerid), playeridtext);
        
SendClientMessageToAll(-1,String);
        return 
0;
    }
    else if ( 
PlayerInfo playerid ] [Admin ] == 3)
    {
        new 
String[128];
        
format(Stringsizeof(String), "{996666}[ADMIN] {25A5A8}%s(%d): {FFFFFF}%s",GetName(playerid), playeridtext);
        
SendClientMessageToAll(-1,String);
        return 
0;
    }
    else if ( 
PlayerInfo playerid ] [Admin ] == 4)
    {
      new 
String[128];
      if(
hide[playerid] == 0// Put it here.. less confusing.
      
{
        
format(Stringsizeof(String), "{996666}[MOD] {25A5A8}%s(%d): {FFFFFF}%s",GetName(playerid), playeridtext);
        
SendClientMessageToAll(-1,String);
      }
      else if(
hide[playerid] == 1)
      {
      
format(Stringsizeof(String), "{%06x}%s: {FFFFFF}(%d): %s", (GetPlayerColor(playerid) >>> 8),GetName(playerid), playeridtext);
      
SendClientMessageToAll(-1,String);
      }
      return 
0;
    }
    else if ( 
PlayerInfo playerid ] [Admin ] == 5)
    {
      new 
String[128];
      if(
hide[playerid] == 0// Put it here.. less confusing.
      
{
        
format(Stringsizeof(String), "{996666}[LEADER] {25A5A8}%s(%d): {FFFFFF}%s",GetName(playerid), playeridtext);
        
SendClientMessageToAll(-1,String);
      }
      else if(
hide[playerid] == 1)
      {
      
format(Stringsizeof(String), "{%06x}%s: {FFFFFF}(%d): %s", (GetPlayerColor(playerid) >>> 8),GetName(playerid), playeridtext);
      
SendClientMessageToAll(-1,String);
      }
      return 
0;
    }
    else if ( 
PlayerInfo[playerid][VIP] >= 1)
    {
        new 
String[128];
        
format(Stringsizeof(String), "{ff7109}[DONATOR] {7c459e}%s(%d): {FFFFFF}%s",GetName(playerid), playeridtext);
        
SendClientMessageToAll(-1,String);
        return 
0;
    }
    
SetPlayerChatBubble(playeridtext0xFFFFFFFF35.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;
 } 
this Code Don't Work
PHP код:
    else if ( PlayerInfo[playerid][VIP] >= 1)
    {
        new 
String[128];
        
format(Stringsizeof(String), "{ff7109}[DONATOR] {7c459e}%s(%d): {FFFFFF}%s",GetName(playerid), playeridtext);
        
SendClientMessageToAll(-1,String);
        return 
0;
    }
    
SetPlayerChatBubble(playeridtext0xFFFFFFFF35.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;
    } 
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)