/ostats error REP+
#1

PHP код:
const MAX_COUNTRY_NAME 45;
native GetCountryName(const ipaddress[], country[], size sizeof country);
GetPlayerCountryName(playerid)
{
    new 
ip[34], country[MAX_COUNTRY_NAME];
    
GetPlayerIp(playeridipsizeof(ip));
    new 
ret GetCountryName(ipcountrysizeof(country));
    if(!
ret)
        
format(countrysizeof(country), "Private IP");
    return 
country;

PHP код:
format(tmpsizeof(tmp), "{FFFFFF}IP: {00FF00}%s {FFFFFF} || {FFFFFF}Country: {00FF00}%s\n"dini_Get(file,"IP"), GetPlayerCountryName(dini_Get(file,"IP"))); strcat(stringtmp); 
Код:
D:\Data\SAMP Servers\SATDM\Gamemodes\SATDM~Beta.pwn(20949) : error 035: argument type mismatch (argument 1)
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Reply
#2

Код:
GetPlayerCountryName(dini_Get(file,"IP")));
You're using the IP to grab their country but GetPlayerCountryName() uses playerid.
Reply
#3

So, what should I do?
Reply
#4

Make a second function for IPs.

PHP код:
GetPlayerCountryName(ip[]) 

    new 
country[MAX_COUNTRY_NAME]; 
    new 
ret GetCountryName(ipcountrysizeof(country)); 
    if(!
ret
        
format(countrysizeof(country), "Private IP"); 
    return 
country

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)