Showplayerdialog script base - 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: Showplayerdialog script base (
/showthread.php?tid=467359)
Showplayerdialog script base -
pablodc - 02.10.2013
I need a simple Showplayerdialog for my server command /announce to create a big announce text on my server.
Can someone give me it?
Re: Showplayerdialog script base -
bensmart469 - 02.10.2013
https://sampwiki.blast.hk/wiki/ShowPlayerDialog
If you're using zcmd, you could do something like this (note, you will need to do a loop throughout all players first):
pawn Код:
ShowPlayerDialog(i,9999,DIALOG_STYLE_MSGBOX,"Announcement",params,"Ok","");
Re: Showplayerdialog script base -
pablodc - 02.10.2013
error 017: undefined symbol "i"
Re: Showplayerdialog script base - Patrick - 02.10.2013
you need a loop for it
Code
pawn Код:
for(new i = 0; i < MAX_PLAYERS; i++)
return ShowPlayerDialog(i,9999,DIALOG_STYLE_MSGBOX,"Announcement",params,"Ok","");
Re: Showplayerdialog script base -
Konstantinos - 02.10.2013
EDIT: I misread. Do what pds2012 said!
Re: Showplayerdialog script base -
bensmart469 - 02.10.2013
Quote:
Originally Posted by pds2012
you need a loop for it
Code
pawn Код:
for(new i = 0; i < MAX_PLAYERS; i++) return ShowPlayerDialog(i,9999,DIALOG_STYLE_MSGBOX,"Announcement",params,"Ok","");
|
Wouldn't this show the dialog for one person only?
You could possibly do this:
pawn Код:
for(new i=0; i<MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
ShowPlayerDialog(i,9999,DIALOG_STYLE_MSGBOX,"Announcement",params,"Ok","");
}
}
Re: Showplayerdialog script base - Patrick - 02.10.2013
Quote:
Originally Posted by bensmart469
Wouldn't this show the dialog for one person only?
You could possibly do this:
pawn Код:
for(new i=0; i<MAX_PLAYERS; i++) { if(IsPlayerConnected(i)) { ShowPlayerDialog(i,9999,DIALOG_STYLE_MSGBOX,"Announcement",params,"Ok",""); } }
|
Mine or yours works the same, you just added
IsPlayerConnected to check if the player that inside the loop is connected.