SA-MP Forums Archive
GetPlayerIpEx - 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)
+--- Thread: GetPlayerIpEx (/showthread.php?tid=284021)



GetPlayerIpEx - Berky - 17.09.2011

Код:
stock GetPlayerIpEx(playerid)
{
	new playerip[32];
	GetPlayerIp(playerid, playerip, sizeof(playerip));
	return playerip;
}
Some of the player IP's return "None" / "Unknown".
Would it be a fix to add this at OnPlayerConnect?
Код:
if(GetPlayerIpEx(playerid) == "None" || GetPlayerIpEx(playerid) == "Unknown")
{
    SendClientMessage(playerid, COLOR_LIGHTRED, "[SERVER] You have been kicked from the server for having an invalid Ip Adress.");
    Kick(playerid);
}



Re: GetPlayerIpEx - System64 - 17.09.2011

I don't understand you...


Re: GetPlayerIpEx - austin070 - 17.09.2011

No. Almost 100% of people would have a "valid" IP address.


Re: GetPlayerIpEx - =WoR=Varth - 17.09.2011

Where you get the player's IP?


Re: GetPlayerIpEx - Berky - 17.09.2011

Some players hide their IP adress and it returns, when using GetPlayerIp as "Unknown" or "None". So I am just wondering if the fix above would help. Because I have experienced it before and today, today some DDoSer DDoSed my server, heavily and I wanted to know if the above script would possibly fix it.


Re: GetPlayerIpEx - wouter0100 - 17.09.2011

No, it dont fix the ddos, it's a attack of services, you can't fix it with a simple kick. (Its not SAMP/GTA side)


Re: GetPlayerIpEx - Berky - 17.09.2011

I meant if it would get rid of the player from login in with an invalid Ip Adress.


Re: GetPlayerIpEx - [MG]Dimi - 17.09.2011

There is no such thing as invalid IP Adress. Every IP is valid


Re: GetPlayerIpEx - [NoV]LaZ - 17.09.2011

You're basically comparing strings, use strcmp for that. That's the technical side, but practically that check is useless.


Re: GetPlayerIpEx - Berky - 17.09.2011

Why is it useless, people use an ip hider to manage some sort of way to not to display their ip adress. In that case when we check their ip it results in "None" or "Unknown", just believe it, it happends. I made a mistake in the script but still you got the idea of it, and why shouldn't it be succesful?