Servers advertisment - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Servers advertisment (
/showthread.php?tid=149510)
Servers advertisment -
DevilRP - 22.05.2010
How can i make it so
if a player types a number between 1-255 . 1-255 . 1-255 . 1-255 it will ban him
Re: Servers advertisment -
ViruZZzZ_ChiLLL - 22.05.2010
pawn Код:
public OnPlayerText(playerid, text[])
{
return 1;
}
Re: Servers advertisment -
DevilRP - 22.05.2010
lol.. thanks for letting me know there is a public like that..
but seriously what do i do?
Re: Servers advertisment -
DarkPower - 22.05.2010
try this, i didnt check
pawn Код:
stock bool: IsIPInText(txt[])
{
new
pos = 0,
_1,
_2,
_3,
_4,
str[9],
delims[] =
{
';', '|',
',', ' ',
'.', '-',
'~', '*',
'/'
};
while(txt[pos])
{
for(new n = 0; n < sizeof(delims); n++)
{
format(str, sizeof(str), "p<%c>dddd", delims[n]);
if(!sscanf(txt[pos], str, _1, _2, _3, _4))
{
if(0 <= _1 <= 255 &&
0 <= _2 <= 255 &&
0 <= _3 <= 255 &&
0 <= _4 <= 255)
{
return true;
}
}
}
pos++;
}
return false;
}
use sscanf
Re: Servers advertisment -
DevilRP - 22.05.2010
Thanks but i dont have scanf
only got defult
Re: Servers advertisment -
[MWR]Blood - 22.05.2010
Put numbers in antiswear, so it will become a '*' in the chat.
There is no way to make the thing u want, because it will ban the player when he types every number.
Re: Servers advertisment -
Steven82 - 22.05.2010
This is just wrong and fucked up
Re: Servers advertisment -
DevilRP - 22.05.2010
Thanks man! you're great!
But it does nothing when i type 1.1.2.5
where do i add the ban or kick feature?
Re: Servers advertisment -
DarkPower - 22.05.2010
he say ONLY when he type FULL IP something like this
188.72.225.174:3500 then will work
Re: Servers advertisment -
BLAbla93 - 22.05.2010
Код:
if(IsIP(text[]))
{
Ban(playerid);
return1;
}
i think this is what you would put that under onplayertext