SA-MP Forums Archive
Rules - 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: Rules (/showthread.php?tid=295004)



Rules - Trucker[UK] - 04.11.2011

Hi

Can anyone help me with this

Can anyone help me when a player connects for the first time a dialog appears with the rules instead of typing /rules

Thanks


Re: Rules - SmiT - 04.11.2011

pawn Код:
OnPlayerConnect( playerid )
{
    ShowPlayerDialog( playerid, 1, DIALOG_STYLE_MSGBOX, #Rules, #My server rules are: ... , #Ok, #Quit );
    return true;
}
https://sampwiki.blast.hk/wiki/OnPlayerConnect
https://sampwiki.blast.hk/wiki/ShowPlayerDialog


Re: Rules - Jack_Rocker - 04.11.2011

Well, assuming you have a registration system you will need to make a player 'stat' called First logged... Then under onplayerconnect, you will need to have it check wether the stat is true or false, if it is true, then shows the dialog and sets it to false, if it is false it just carries on as normal.

Also, Smit is wrong as that will show every time someone logs in + The code is wrong anyway.


Re: Rules - =WoR=G4M3Ov3r - 04.11.2011

PHP код:
OnPlayerConnect(playerid)
{
    
ShowPlayerDialog(playerid1DIALOG_STYLE_MSGBOX"Rules""You must abide the following rules: [Type your rules, and use /n to indent a line""Done""Quit");
    return 
1;

What's your registration variable ?, in my case, it'll show every single time you connect.


Re: Rules - =WoR=G4M3Ov3r - 04.11.2011

Quote:
Originally Posted by ******
Посмотреть сообщение
How do you know when a player has never connected before, rather than just not yet logged in?
PHP код:
OnPlayerConnect(playerid)
{
  if(
IsPlayerConnected(playerid))
    {
    
ShowPlayerDialog(playerid1DIALOG_STYLE_MSGBOX"Rules""You must abide the following rules: [Type your rules, and use /n to indent a line""Done""Quit");
    return 
1;