#1

PHP код:
CMD:i(playeridparams[])
{
   new 
ID,string[300], string3[300], string4[128], name[60];
   if(
sscanf(params"u"ID)) SendClientMessage(playeridCOLOR_WHITE"USAGE: /i [id]");
   else if(
IsPlayerConnected(ID) == 0SendClientMessage(playeridCOLOR_RED"Player is not connected!");
   else
   {
         
HideDraw(playerid);
          
GetPlayerName(IDname60); 
Is there anything wrong with sscanf?

I don't know if 2 players using this cmd at same time

It works like this:

PLAYER A typed /i 2
PLAYER B typed /i 1

Like if they use this cmd at same time so PLAYER B typed /i 1 so it shows to player A and player B /i 1.

I mean, it should show to player A /i 2 and to player B /i 1 and if player C type /i 3 so it shows to players C /i 3

Idk it bugged when 2 players use this cmd at same time. it shows to both screen what player B typed.
Reply
#2

Maybe try this im not sure
Quote:

CMD:i(playerid, params[])
{
new ID,string[300], string3[300], string4[128], name[60];
if(sscanf(params, "u", playerid)) SendClientMessage(playerid, COLOR_WHITE, "USAGE: /i [id]");
else if(IsPlayerConnected(playerid) == 0) SendClientMessage(playerid, COLOR_RED, "Player is not connected!");
else
{
HideDraw(playerid);
GetPlayerName(playerid, name, 60);

Reply
#3

You didnt change anything -.-
Reply
#4

You need to use the new include sscanf2 + dont use 'else'

Quote:

CMD:i(playerid, params[])
{
new ID,string[300], string3[300], string4[128], name[MAX_PLAYER_NAME];
if(sscanf(params, "u", ID)) SendClientMessage(playerid, COLOR_WHITE, "USAGE: /i [id]");
if(!IsPlayerConnected(ID)) SendClientMessage(playerid, COLOR_RED, "Player is not connected!"); //Here check if is connected the PlayerID that your type.
HideDraw(ID);//Here hide the Draw of the PlayerID that you type, not your self
GetPlayerName(ID, name, MAX_PLAYER_NAME);//Here is to get the PlayerID that you type, not your self

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)