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



ID Bug - Ceez - 12.06.2013

Hey, I'm experiencing a Invalid Target ID Bug in my server.
I use the if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR, "Invalid Target ID.");
There's nothing wrong in it, the point is,
Every time a player logs in, You can use commands on him, example, you login as ID 0,
You /q, you re-log, you're ID 0 still since nobody joined,
You try a command on your ID like /isafk 0 or /kick 0 or /ban 0 or any single command that requires targetid it will give you "Invalid Target ID"
Tried to update my sscanf, I just dragged the files to my script folder and recompiled the script,
anything else i need to do to fix this?


Re: ID Bug - Chasm - 12.06.2013

Not really a bug.

pawn Код:
if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR, "Invalid Target ID.");
Try using targetid instead of playerid, you have to have a variable
pawn Код:
new targetid;



Re: ID Bug - Ceez - 12.06.2013

playerid is the sender id,
targetid is the giveplayerid aka the person you do the command on
EDIT: MY BAD, I WROTE IN TOPIC isplayerconnected(playerid) instead of isplayerconnected(targetid), i use the targetid one on script.


Re: ID Bug - Ceez - 12.06.2013

ive been told its related to sscanf, anyone has an idea what to do?
re-downloaded the latest version, placed in script folder, re compiled gamemode, still got the problem


Re: ID Bug - Affan - 12.06.2013

pawn Код:
if(!IsPlayerConnected(playerid) == 0) return SendClientMessage(playerid, COLOR, "Invalid Target ID.");
You can replace playerid with targetid if you want, but i recommend to use playerid.


Re: ID Bug - Ceez - 12.06.2013

Didn't help


Re: ID Bug - SilverKiller - 12.06.2013

Had that problem before, change "u" in the sscanf line to "i", that worked for me.