SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 16/07/2013, 12:27 PM   #1
deimantas1
Big Clucker
 
Join Date: Jul 2011
Location: SA-MP
Posts: 93
Reputation: -1
Default IP

Hello, I want create that my name: Deimis_Extar nothing can't connect. I try create with IP checking, but always me kick. I check my IP with command, and me wrote this IP.

Code:
	if(strcmp(ZaidejoVardas(playerid),"Deimis_Extar",true))
	{
		if(strcmp(ZaidejoIP(playerid),"127.0.0.1",true)) return 1;
		if(!strcmp(ZaidejoIP(playerid),"127.0.0.1", true))
		{
			SendClientMessage(playerid,GELTONA,"Nesutampa");
 			SetTimerEx("KickPlayer",500,false,"d",playerid);
  		}
	}

What's wrong?
deimantas1 is offline   Reply With Quote
Old 16/07/2013, 07:21 PM   #2
ReVo_
Gangsta
 
ReVo_'s Avatar
 
Join Date: Oct 2009
Posts: 530
Reputation: 73
Default Re: IP

Because if you are a dynamic IP it changes every time.
ReVo_ is offline   Reply With Quote
Old 16/07/2013, 07:23 PM   #3
DreDasLT
Little Clucker
 
Join Date: Apr 2011
Location: Lithuania
Posts: 43
Reputation: 0
Default Re: IP

Sveikas.

PHP Code:
if(!strcmp(ZaidejoVardas(playerid),"Deimis_Extar",true))
{
   if(
strcmp(ZaidejoIP(playerid),"127.0.0.1"true))
  {
    
SendClientMessage(playerid,GELTONA,"Nesutampa");
     
SetTimerEx("KickPlayer",500,false,"d",playerid);
  }

DreDasLT is offline   Reply With Quote
Old 16/07/2013, 07:26 PM   #4
DreDasLT
Little Clucker
 
Join Date: Apr 2011
Location: Lithuania
Posts: 43
Reputation: 0
Default Re: IP

Quote:
Originally Posted by ReVo_ View Post
Because if you are a dynamic IP it changes every time.
Localhost never changes.
DreDasLT is offline   Reply With Quote
Old 16/07/2013, 10:56 PM   #5
ReVo_
Gangsta
 
ReVo_'s Avatar
 
Join Date: Oct 2009
Posts: 530
Reputation: 73
Default Re: IP

Quote:
Originally Posted by DreDasLT View Post
Localhost never changes.
He never said he uses this script always in a localhost server. (Just why he used 127.0.0.1 in his first post doesn't mean he dont try the code in a hosted server)

If you use this script in a hosted server, this will never work. Maybe in a local test server will work.
ReVo_ is offline   Reply With Quote
Old 17/07/2013, 01:08 PM   #6
deimantas1
Big Clucker
 
Join Date: Jul 2011
Location: SA-MP
Posts: 93
Reputation: -1
Default Re: IP

My IP is static.

DreDas - thanks, working.
deimantas1 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



All times are GMT. The time now is 06:42 PM.


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