SA-MP Forums Archive
LookUP - 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: LookUP (/showthread.php?tid=626450)



LookUP - iLearner - 15.01.2017

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.




Re: LookUP - iLearner - 15.01.2017



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


Re: LookUP - iLearner - 15.01.2017

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)


Re: LookUP - iLearner - 15.01.2017

I ended up fixing it myself... sorry for the posts.


Re: LookUP - saffierr - 15.01.2017

Nice quadruple post

Btw, what does Region and Isp stand for?


Re: LookUP - iLearner - 15.01.2017

ISP: Internet Service Provider.
Region: Region o.o


Re: LookUP - oMa37 - 15.01.2017

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