Question - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Question (
/showthread.php?tid=347088)
Question -
AnonymousUser - 31.05.2012
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.
Re: Question -
Vince - 31.05.2012
https://sampwiki.blast.hk/wiki/OnPlayerClickPlayer
Re: Question -
MadeMan - 31.05.2012
Use MAX_PLAYERS loop with IsPlayerConnected
https://sampwiki.blast.hk/wiki/IsPlayerConnected
Re: Question -
AnonymousUser - 31.05.2012
Quote:
Originally Posted by MadeMan
|
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 :/
Re: Question -
MadeMan - 31.05.2012
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