Showplayerdialog script base
#1

I need a simple Showplayerdialog for my server command /announce to create a big announce text on my server.
Can someone give me it?
Reply
#2

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","");
Reply
#3

error 017: undefined symbol "i"
Reply
#4

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","");
Reply
#5

EDIT: I misread. Do what pds2012 said!
Reply
#6

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","");
    }
}
Reply
#7

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)