SA-MP Forums Archive
OnPlayerRequestClass Read More Here! - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: OnPlayerRequestClass Read More Here! (/showthread.php?tid=275107)



OnPlayerRequestClass Read More Here! - lyrics - 08.08.2011

Hi i want my rules show up OnPlayerRequestClass
I want after i click accept the dialog will never appear again OnPlayerRequestClass
How can i do that?

Heres All Code:

pawn Код:
if(strcmp("/rules", cmdtext, true, 10) == 0)
 {
    ShowPlayerDialog(playerid,2, DIALOG_STYLE_MSGBOX, "Rules:", "1.)Do Not Hack/Cheat/Mods\n2.)Respect Admins And Players\n3.)Do Not Ask To Be Admin We Choosing Admins\n4.)Do Not Use Admin Account And Try To Use It\n5.)No Insulting, Flamming The Admins\n6.)Dont Kill Player To Much (Spawn Killing)\nIf you break those rules you may Punishment by Our Server Administrators", "Accept", "Ignore");
    return 1;
 }
pawn Код:
if(dialogid == 2)
  {
     if(response == 1)
     {
     SetPlayerScore(playerid, GetPlayerScore(playerid) + 5);
     GivePlayerMoney(playerid, 50000);
         SendClientMessage(playerid, COLOR_GREEN, "You Accept The Rules You Recieve $500000 + 5 Score Points");
     }
     else
     {
        SendClientMessage(playerid, COLOR_RED, "You Ignore The Rules");
        SendClientMessage(playerid, COLOR_RED, "You Have Been Kicked!, Reason : Ignoring The Rules");
    Kick(playerid);
     }
     return 1;
  }
I hope you help me


Re : OnPlayerRequestClass Read More Here! - Soumi - 08.08.2011

I Suggest you move the rules dialog after The Registration or the log in dialog.


Re: OnPlayerRequestClass Read More Here! - Basicz - 08.08.2011

Just use Variables.
pawn Код:
new
    bool: showRulesState[ MAX_PLAYERS ]
;

public OnPlayerConnect( playerid )
{
    showRulesState[ playerid ] = false;

    return 1;
}

public OnPlayerRequestClass( playerid, classid )
{
    if ( !showRulesState[ playerid ] )
    {
        ShowPlayerDialog(playerid,2, DIALOG_STYLE_MSGBOX, "Rules:", "1.)Do Not Hack/Cheat/Mods\n2.)Respect Admins And Players\n3.)Do Not Ask To Be Admin We Choosing Admins\n4.)Do Not Use Admin Account And Try To Use It\n5.)No Insulting, Flamming The Admins\n6.)Dont Kill Player To Much (Spawn Killing)\nIf you break those rules you may Punishment by Our Server Administrators", "Accept", "Ignore");
 
        showRulesState[ playerid ] = true;
    }

    return 1;
}
Hope this can help you


Re : OnPlayerRequestClass Read More Here! - Soumi - 08.08.2011

Showing this dialog after your register dialog is better, because this dialog will show up everytime the player chooses a class, so he will keep getting Money and score if he presses Accept button.


Re: OnPlayerRequestClass Read More Here! - lyrics - 08.08.2011

Quote:
Originally Posted by Basicz
Посмотреть сообщение
Just use Variables.
pawn Код:
new
    bool: showRulesState[ MAX_PLAYERS ]
;

public OnPlayerConnect( playerid )
{
    showRulesState[ playerid ] = false;

    return 1;
}

public OnPlayerRequestClass( playerid, classid )
{
    if ( !showRulesState[ playerid ] )
    {
        ShowPlayerDialog(playerid,2, DIALOG_STYLE_MSGBOX, "Rules:", "1.)Do Not Hack/Cheat/Mods\n2.)Respect Admins And Players\n3.)Do Not Ask To Be Admin We Choosing Admins\n4.)Do Not Use Admin Account And Try To Use It\n5.)No Insulting, Flamming The Admins\n6.)Dont Kill Player To Much (Spawn Killing)\nIf you break those rules you may Punishment by Our Server Administrators", "Accept", "Ignore");
 
        showRulesState[ playerid ] = true;
    }

    return 1;
}
Hope this can help you
Thanks it work!