03.06.2009, 16:18
How to make no advertising? so, you can't write server IP's!
Originally Posted by BigNewBie
How to make no advertising? so, you can't write server IP's!
|
IpCheck(playerid, text[])
{
new var, pos, oldpos;
oldpos = strfind(text, ".", true);
if(strval(text[oldpos - 1]) == 0) return 1;
while((pos = strfind(text, ".", true, pos + 1)) != -1 && pos - oldpos <= 4)
{
var++;
if(strval(text[pos + 1]) == 0 || text[pos + 1] == ' ') return 1;
oldpos = pos;
if(var == 3 && (pos = strfind(text, ":", true, pos + 1)) != -1)
{
if(strval(text[pos + 1]) == 0 || text[pos + 1] == ' ') return 1;
BanEx(playerid, "Advertising");
return 0;
}
}
return 1;
}
public OnPlayerText(playerid, text)
{
IpCheck(playerid, text);
return 1;
}
public OnPlayerPrivMsg(playerid, senderid, text)
{
IpCheck(senderid, text);
return 1;
}
public OnPlayerCommandText(playerid, cmdtext)
{
IpCheck(playerid, cmdtext);
return 0;
}