Question
#1

How to make a command, for example, /players witch would open a GUI with all players connected, and when you press on any player, it would teleport you to the selected player. I tried to make something like this, but if I would use loop with MAX_PLAYERS, it would be fucked up, because it would show even not connected players.

Ty.
Reply
#2

https://sampwiki.blast.hk/wiki/OnPlayerClickPlayer
Reply
#3

Use MAX_PLAYERS loop with IsPlayerConnected

https://sampwiki.blast.hk/wiki/IsPlayerConnected
Reply
#4

Quote:
Originally Posted by MadeMan
Посмотреть сообщение
Use MAX_PLAYERS loop with IsPlayerConnected

https://sampwiki.blast.hk/wiki/IsPlayerConnected
ty, I've got that, but I don't get, how to check on which player pressed in OnDialogResponse? I should create array, or something? Don't get it at all :/
Reply
#5

Example:

When showing the dialog:

pawn Код:
new info[512];
new pname[24];
for(new i=0; i < MAX_PLAYERS; i++)
{
    if(IsPlayerConnected(i))
    {
        GetPlayerName(i, pname, sizeof(pname));
        format(info, sizeof(info), "%s%d - %s\n", info, i, pname);
    }
}
ShowPlayerDialog(playerid, ..., info, ...);
OnDialogResponse:

pawn Код:
new id = strval(inputtext);
// id is the id of the player selected
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)