ID Bug
#1

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?
Reply
#2

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;
Reply
#3

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.
Reply
#4

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
Reply
#5

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.
Reply
#6

Didn't help
Reply
#7

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


Forum Jump:


Users browsing this thread: 1 Guest(s)