Player 1 is not online but he is (ONLY PLAYERID 1)
#1

Hi, nobody can use commands on a player with the id 1, I don't know why...

pawn Код:
if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Player is not online.");
Everybody else 0 & 2+ can be affected by commands.

Solved
Reply
#2

Try this...

Код:
if(!IsPlayerConnected(id))return SendClientMessage(playerid,COLOR_RED,"Player is not online");
Reply
#3

Quote:
Originally Posted by -=Dar[K]Lord=-
Посмотреть сообщение
Try this...

Код:
if(!IsPlayerConnected(id))return SendClientMessage(playerid,COLOR_RED,"Player is not online");
I have this check on some commands also. So I don't think that would work.
Reply
#4

deleted
Reply
#5

It's possible the ID isn't being set properly. Are you using sscanf? It'd be useful in more code was shown within the context.
Reply
#6

pawn Код:
new id;
if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_RED, "/test [id]");
if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Player is not online.");
Reply
#7

I think you defined INVALID_PLAYER_ID to ID 1
Reply
#8

How is that possible? I haven't defined anything along the lines "INVALID_PLAYER_ID" I just checked, twice.
Reply
#9

If you use the "u" specifier you should not be using INVALID_PLAYER_ID. For that, you'd want to operate with "d", however simply change it to an IsPlayerConnected statement.

pawn Код:
if(IsPlayerConnected(playerid)) // ...
Reply
#10

Hmmm, I'll check it.

EDIT: Thank you!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)