Jump to content

[INC]TrackIP


Guest farse

Recommended Posts

Guest farse

[shadow=purple,left]TrackIP[/shadow][shadow=black,left]By Farse[/shadow]

[glow=yellow,2,300][shadow=purple,left]Informatii generale:[/shadow][/glow]

Intai am vrut sa il fac doar pt sa-mp.ro server,dar na...Am lucrat la el 1 h-mai mult a durat sa fac rost de un geoip cu format xml decat scriptu pwn.

Este un Plugin-Free si merge rapid,nu face lag la server,dar dureaza putin pana cand primeste datele(nu va afecta serverul).

Poti afla cu el:

Codul Tarii: RO

Numele Tarii:Romania

Regiunea: Iasi(normal ar fi trecut sa fie Moldova,dar Romania fiind o tara limitrofa Africii...)

Orasul:Iasi

ZipCode: la romani nu merge.

Latitudine-Longitudine: ????

timeZone: cu cat e mai departe/aproape de ora GMT.

Link de Download:

http://src-clan.net/files/TrackIP.inc - Dai click dreapta si Save As..

http://src-clan.net/files/TrackIP.html - Fake pastebin.

Cum sa il instalezi:

1.Pui fisierul de mai sus in includes.

2.Deschizi modu/un fs.

3.pui #include <TrackIP> la inceputul modului.

4.la OnPlayerConnect pui TrackPlayerIp( playerid ); (vroiam sa il fac cu y_hooks dar poate unii nu vor sa afle datele direct la OnPlayerConnect)

5.IN AFARA ORICAREI FUNCTII, pui

[tt] public OnPlayerIpTracked(playerid)

{

return 1;

}[/tt]

Aici poti folosi functiile din inc.

FUNCTII:

[tt]TrackPlayerIp( playerid )

GetPlayerCountryCode(playerid)

GetPlayerCountryName(playerid)

GetPlayerRegionName(playerid)

GetPlayerCityName(playerid)

GetPlayerGMT(playerid)

GetPlayerZIPCode(playerid)

Float:GetPlayerLatitude(playerid)

Float:GetPlayerLongitude(playerid)[/tt]

Nu cred ca ar mai trebui si explicatii pt fiecare.

Exemplu:

#include <a_samp>
#include <TrackIP.inc>
public OnFilterScriptInit()
{
	if(IsPlayerConnected(0))
		OnPlayerConnect(0);
	return printf("HI");
}
public OnFilterScriptExit()
{
	return 1;
}
public OnPlayerConnect(playerid)
{
	TrackPlayerIp(playerid);
	return 1;
}

public OnPlayerIpTracked(playerid)
{
	new str[ 124 ];
	format(str,124, "Te-ai Conectat din orasul {FF00FF}%s{FFFFFF} (Regiunea:{FF00FF}%s{FFFFFF}) tara {FF00FF}%s(%s)",GetPlayerCityName(playerid),GetPlayerRegionName(playerid),GetPlayerCountryName(playerid),GetPlayerCountryCode(playerid));
	SendClientMessage(playerid,~0,str);
	format(str,124, "Ora ta este cu %s GMT,(ZIP Code:%s) te aflii la o latitudine de %.3f si o longitudine de %.3f",GetPlayerGMT(playerid),GetPlayerZIPCode(playerid),GetPlayerLatitude(playerid),GetPlayerLongitude(playerid));
	SendClientMessage(playerid,~0,str);
	return 1;
}

public OnPlayerDisconnect(playerid,reason)
	return 1;

->

testTip.PNG

Link to comment
Share on other sites

public OnFilterScriptInit()
{
	if(IsPlayerConnected(0))
		OnPlayerConnect(0);
	return printf("HI");
}

lol

N-ar fi bine ca daca rezultat unui string este nulla, adica a dat gres la a lua date, sa arate Unknown? :)

Numai sa critici stii.

Prea tare, o sa-i fac un timp de viteza, daca e bun timpul, o sa-l folosesc :D

Tare, 5/5.

Link to comment
Share on other sites

stuntman-=!!" post="62530" timestamp="1300997271"]

Prea tare, o sa-i fac un timp de viteza, daca e bun timpul, o sa-l folosesc :D

Time taken to execute TrackPlayerIp for playerid 0: 3 - asta o data

Time taken to execute OnPlayerIpTraken for playerid 0: 93 - asta de 1000 de ori

Coduri pentru test:

TrackPlayerIp:

public OnPlayerConnect(playerid)
{
    new count = GetTickCount();
	TrackPlayerIp(playerid);
	printf("Time taken to execute TrackPlayerIp for playerid %d: %d", playerid, GetTickCount() - count);
	return 1;
}
OnPlayerIpTracked:
public OnPlayerIpTracked(playerid)
{
    new count = GetTickCount();
	new str[ 124 ];
	for(new i; i < 1000; i++)
	{
		format(str,124, "Te-ai Conectat din orasul {FF00FF}%s{FFFFFF} (Regiunea:{FF00FF}%s{FFFFFF}) tara {FF00FF}%s(%s)",GetPlayerCityName(playerid),GetPlayerRegionName(playerid),GetPlayerCountryName(playerid),GetPlayerCountryCode(playerid));
		SendClientMessage(playerid,~0,str);
		format(str,124, "Ora ta este cu %s GMT,(ZIP Code:%s) te aflii la o latitudine de %.3f si o longitudine de %.3f",GetPlayerGMT(playerid),GetPlayerZIPCode(playerid),GetPlayerLatitude(playerid),GetPlayerLongitude(playerid));
		SendClientMessage(playerid,~0,str);
	}
	printf("Time taken to execute OnPlayerIpTracked for playerid %d: %d", playerid, GetTickCount() - count);
	return 1;
}

Nu prea localizeaza orasul si ZIP-ul bine, dar merge bine in rest, o sa-l folosesc doar pentru tara, longitudine si latitudine :D

Link to comment
Share on other sites

Guest farse

stuntman,testu e fail,dc ai pus in loop 2 formaturi si 2 sendmessage? trebuia sa faci testu in .inc

Si nu are cum sa faca lag,am folosit doar strmid si HTTP,nu e nuj' ce cod lung de o face lag,o sa dureze jumate de secunda/o secunda pana cand primeste datele de pe src-clan.net (dar asta se intampla in tot'dauna cand folosesti HTTP) si nu o sa blocheze serverul pana atunci.

Link to comment
Share on other sites

Guest PlayON

stuntman-=!!" post="62530" timestamp="1300997271"]

public OnFilterScriptInit()
{
	if(IsPlayerConnected(0))
		OnPlayerConnect(0);
	return printf("HI");
}

lol

Numai sa critici stii.

Prea tare, o sa-i fac un timp de viteza, daca e bun timpul, o sa-l folosesc :D

Tare, 5/5.

Cred ca daca am face toti dupa tine am primi crashuri, peste altele....

AM criticat, nu de asta avem nevoie cu totii?

Link to comment
Share on other sites

  • 1 month later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.