LookUP
#1

Hey,

i was thinking to use the lookup script, thus i found emmet's include, but its no longer available nor his api is available, so i am using this one: https://sampforum.blast.hk/showthread.php?tid=607276

I've made a small script, filterscript, i used the function without the callback onlookup complete, and the dialog did not show anything, (no data), but when i used the onlookupcomplete callback, it spammed the shit & did not show anything, here's the script:

PHP код:
#include <a_samp>
#include <zcmd>
#include <sscanf2>
#include <lookup>
#define cgreen                        "{8FFF8B}"
#define cadmin                        "{ff0cd0}"
#define cred                         "{FF0000}"
CMD:stalk(playeridparams[])
{
    new 
country[60], region[80], city[60], isp[80], timezone[20], zipcode[10], id;
    if(
sscanf(params"i"id)) return SendClientMessage(playerid, -1"Usage: /stalk <playerid>");
    
GetPlayerCountry(idcountrysizeof(country));
    
GetPlayerRegion(idregionsizeof(region));
    
GetPlayerCity(idcitysizeof(city));
    
GetPlayerISP(idispsizeof(isp));
    
GetPlayerTimezone(idtimezonesizeof(timezone));
    
GetPlayerZipcode(idzipcodesizeof(zipcode));
    new 
str[1000], pname[24], idname[24];
    
GetPlayerName(ididname24);
    
GetPlayerName(playeridpname24);
    
format(strsizeof(str), "\t"cadmin"Showing information for player: %s(%i) Requested by:%s(%i)\n\n"idnameidpnameplayerid);
    
format(strsizeof(str), "%s "cred"Player Country: "cgreen"%s\n"cred"Player Region: "cgreen"%s\n"cred"Player City: "cgreen"%s\n ",strcountryregioncity);
    
format(strsizeof(str), "%s "cred"Player ISP: "cgreen"%s\n"cred"Player Timezone: "cgreen"%s\n"cred"Player zipcode: "cgreen"%s\n\n "cadmin"*Provided information MAY NOT be 100% accurate!",strisptimezonezipcode);
    
ShowPlayerDialog(playerid105DIALOG_STYLE_MSGBOX"Player Information"str"Okay""");
    return 
1;
}
public 
OnLookupComplete(playerid){
    return 
1;

What did i do wrong? when i use /stalk, even without id, it shows this:

Quote:

[13:51:49] Filterscript 'lookup.amx' loaded.

[13:51:49] Optimus_Prime (1: {FFFFFF}i fucking lost 18 millions

[13:51:58] Usage: /stalk <playerid>

[13:51:58] gzswcb (83) has joined the server.

[13:52:00] [DEBUG] LookUpCompleted!

[13:52:00] [DEBUG] LookUpCompleted!

[13:52:00] [DEBUG] LookUpCompleted!

[13:52:00] [DEBUG] LookUpCompleted!

[13:52:00] [DEBUG] LookUpCompleted!

[13:52:01] [DEBUG] LookUpCompleted!

[13:52:01] [DEBUG] LookUpCompleted!

[13:52:01] [DEBUG] LookUpCompleted!

[13:52:01] [DEBUG] LookUpCompleted!

[13:52:02] [DEBUG] LookUpCompleted!

[13:52:02] [DEBUG] LookUpCompleted!

[13:52:14] [DEBUG] LookUpCompleted!

[13:52:21] Filterscript 'lookup.amx' unloaded.

Reply
#2



Seems like all functions return null, for all players.
(had removed the callback onlookupcomplete)
Reply
#3

With some fixes, when i tested, it returns the information for 10% of players (i tried on 15/80 & 2 returned information, in which 1 was my id), for the rest its null. (blank as in image above)

UPDATE: I noticed, the information is only given when all fields are available (eg, if zipcode is not available the information will not be taken at all, it will fetch only in case all information is available on api)
Reply
#4

I ended up fixing it myself... sorry for the posts.
Reply
#5

Nice quadruple post

Btw, what does Region and Isp stand for?
Reply
#6

ISP: Internet Service Provider.
Region: Region o.o
Reply
#7

Just a note; Use 'u' specifier for players IDs.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)