error custom func when input y_timers
#1

hi, i use custom function for get player ip

PHP код:
stock GetIP(playerid) // 419
{
    new 
ips[20];
    
GetPlayerIp(playerid, ips, sizeof(ips)); // 422
    
return ips;
} 
but, after i input
PHP код:
#include <YSI\y_timers> 
and i got error
PHP код:
project.pwn(419) : error 001: expected token: "-identifier-", but found "("
project.pwn(422) : error 021: symbol already defined: "GetPlayerIp"
project.pwn(423) : error 010: invalid function or declaration
project
.pwn(431) : warning 203: symbol is never used: "ips"
Pawn compiler 3.2.3664              Copyright (c) 1997-2006, ITB CompuPhase 
so?what solution? but dont make custom function lost?
Reply
#2

Why don't you simply do something like this?

PHP код:
//top
new Player_IP[MAX_PLAYERS];
// on player connect
GetPlayerIp(playerid, Player_IP[playerid], 16);
// example usage
new string[128];
format(string, sizeof(string), "Your IP Address: %s", Player_IP[playerid]);
SendClientMessage(playerid, -1, string); 
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)