SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 06/09/2014, 10:14 PM   #11
IceCube!
High-roller
 
IceCube!'s Avatar
 
Join Date: Aug 2011
Location: Grove Street, Home; Atleast it was before I fucked everything up. Motto: Carpe Diem, Bitch!
Posts: 1,765
Reputation: 230
Default Re: Check if string contains an IP address

Okay I did write something in this box here, not sure if it will work.. but I'm sure someone can extract the idea I had from it and make it properly as my computer is lagging due to extracting serveral IMG's. Thus I lost train of thought making this:

pawn Code:
stock ValidIP(string[])
{
    new dotcout, gap[4];
    for (new i = 0; sizeof(string), i++)
    {
        if (('.' == string[i]) && ('0' <= string[i + 1] <= '9'))
        {
            gap[dotcount] = i;
            dotcount++;
        }
        if (dotcount == 3)
        {
            if ((1 <= dotcount <= 3) && (string[i + 1] = ':')  && (((gap[0] - gap[1]) == 2)) || ((gap[0] - gap[1]) == 3)) && (((gap[1] - gap[2]) == 2)) || ((gap[1] - gap[2]) == 3)) && (((gap[2] - gap[3]) == 2)) || ((gap[2] - gap[3]) == 3)) )
            {
                //Player is sending an IP.
            }
        }
    }
}

Expect errors, I did write this in the quick reply box.

EDIT: Edited a few things, still not convinced it will work... however let me know if you make it work :P. I'm interested to know if the idea is doable? ATM we're missing the first part of an IP this.x.x.xort
__________________

Image by Phyzic
Projects (28/01/2017)
Skype: Hewlett_T
None.I'm dead, honest!
IceCube! is offline   Reply With Quote
Old 09/06/2016, 01:56 AM   #12
rt-2
Huge Clucker
 
rt-2's Avatar
 
Join Date: Jun 2011
Location: Montréal, Québec, Canada
Posts: 285
Reputation: 26
Default Re: Check if string contains an IP address

Hi,
I found this:
https://github.com/Kar2k/samp-anti-a...dvertising.inc
__________________
rt-2
-------------------------------------------------
rt-2 is offline   Reply With Quote
Old 09/06/2016, 10:03 AM   #13
cessil
High-roller
 
cessil's Avatar
 
Join Date: Apr 2009
Posts: 1,346
Reputation: 296
Default Re: Check if string contains an IP address

wrote this a long time ago
http://pastebin.com/VFvRQEEA

but they will just go around it if you let them know you blocked their text, what I did was put them on ignore for everyone else so they'd only be echo'ing to themselves in the chat
cessil is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
String check Jefff Scripting Help 3 10/05/2013 02:00 PM
Check users under an IP Address Neil. Scripting Help 5 17/02/2013 05:34 PM
check for a exact string Jstylezzz Scripting Help 4 14/10/2012 12:08 PM
How to check if a string contains spaces? Superthijs Scripting Help 7 04/02/2012 11:15 AM
Dialog string check Hipflop Help Archive 5 09/07/2011 06:14 PM


All times are GMT. The time now is 09:04 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.