SA-MP Forums Archive
error custom func when input y_timers - 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: error custom func when input y_timers (/showthread.php?tid=652231)



error custom func when input y_timers - kecoajepit - 06.04.2018

hi, i use custom function for get player ip

PHP код:
stock GetIP(playerid// 419
{
    new 
ips[20];
    
GetPlayerIp(playeridipssizeof(ips)); // 422
    
return ips;

but, after i input
PHP код:
#include <YSI\y_timers> 
and i got error
PHP код:
project.pwn(419) : error 001expected token"-identifier-"but found "("
project.pwn(422) : error 021symbol already defined"GetPlayerIp"
project.pwn(423) : error 010invalid function or declaration
project
.pwn(431) : warning 203symbol is never used"ips"
Pawn compiler 3.2.3664              Copyright (c1997-2006ITB CompuPhase 
so?what solution? but dont make custom function lost?


Re: error custom func when input y_timers - kovac - 06.04.2018

Why don't you simply do something like this?

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