OnDialogResponse
#1

Hello!
How can I check if a player is connected in a dialog_style_input?
if(IsPlayerConnected(inputtext)) ?
Reply
#2

You want check if player is connected so he can use the dialog?Then it's useless because offline players can't use dialogs.
Reply
#3

Use
Код:
IsPlayerConnected(GetPlayerID(inputtext,0))
The stock GetPlayerID:

Код:
stock GetPlayerID(const name[])
{
    new pName[MAX_PLAYER_NAME];
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(!IsPlayerConnected(i)) continue;
        GetPlayerName(i, pName, MAX_PLAYER_NAME);
        if(!strcmp(pName, name))
            return i;
    }
    return INVALID_PLAYER_ID;
}
Reply
#4

In inputtext name or ID?
Reply
#5

Quote:
Originally Posted by stabker
Посмотреть сообщение
In inputtext name or ID?
I suggest to use the ID,it's more effective than NAME.
Reply
#6

Quote:
Originally Posted by Logitech90
Посмотреть сообщение
I suggest to use the ID,it's more effective than NAME.
pawn Код:
if(IsPlayerConnected(strval(inputtext)))
{
//your code here
}
Reply
#7

I insert in a dialog_style_input a NAME
So...inputtext=name
Reply
#8

Quote:
Originally Posted by SumX
Посмотреть сообщение
I insert in a dialog_style_input a NAME
So...inputtext=name
Already showed you the solution in my previous post.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)