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



GetPlayerIP Problem - Blackazur - 01.11.2013

Hello, i have in my ban offline player command a thing that ban the ip too but now my problem is that the targetname[24] have the [24] also a string so i get this problem:

Код:
new targetname[24]
Код:
GetPlayerIp(targetname,ip,sizeof(ip));
Код:
error 035: argument type mismatch (argument 1)
Any help?


Re: GetPlayerIP Problem - SAMProductions - 01.11.2013

This:
Код:
new targetname[24]
Must be like This:
Код:
new targetname[24];
and it is not "targetname" it is "playerid",

Try This:

Код:
GetPlayerIp(playerid, ip, sizeof(ip));



Re: GetPlayerIP Problem - Brandon_More - 01.11.2013

Код:
	new playerip[32];
Код:
	GetPlayerIp(playerid,playerip,32);



Re: GetPlayerIP Problem - Konstantinos - 01.11.2013

Since the player is offline GetPlayerIp function would fail.

Read from the file the IP and do the rest.

PS: The error was given because the first parameter should be integer, but you used a string.


AW: GetPlayerIP Problem - Blackazur - 01.11.2013

Oh, what must i do to ban the player ip if he is offline? I save the ip too in my save player system.


Re: GetPlayerIP Problem - SAMProductions - 01.11.2013

Quote:
Originally Posted by gtakillerIV
Посмотреть сообщение
Read gtakillerIV's Tutorial, it will help you:

How to Make a Command That Bans and Unbans an Offline Player [ZCMD + y_ini + Sscanf]