22.04.2010, 08:39
You need to add a variable that checks if the player agreed the rules.
I'm assuming you're using use The Godfather gamemode, so just add the varaible in the player's array [PlayerInfo],
Then give it back when a player joins your server.
You need to change this line:
With this:
About the admins, just make a command that will change the pAgreedTerms to 0, and just show him the dialog again ;p
I'm assuming you're using use The Godfather gamemode, so just add the varaible in the player's array [PlayerInfo],
Then give it back when a player joins your server.
pawn Code:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 1)
{
if(response)
{
new string[250];
format(string, sizeof(string), "~g~Welcome ~w~To The ~p~Future ~w~Of ~r~SA:MP ~w~Gaming!");
GameTextForPlayer(playerid, string, 5000, 4);
PlayerInfo[pAgreedTerms][playerid] = 1;
}
else
{
new string[300];
format(string, sizeof(string), "/n/n~w~You Selected ~b~Quit, ~w~Therefore You Were ~r~Kicked! ~w~Goodbye!");
GameTextForPlayer(playerid, string, 999999999, 4);
Kick(playerid);
PlayerInfo[pAgreedTerms][playerid] = 0;
}
return 1;
}
return 0;
}
pawn Code:
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_MSGBOX, "Some Simple Rules You Need To Follow...", "Cheating Will Result In An IP Ban. In This Case, You Will Not Be Un-Banned!\nRespect Everyone and Everyones' Property!\nAdministators Are The Boss, Do Not Second Guess Them!\nIf You Ignore An Admin, The Admin Can/Will Ban You, It's Up To Them!\nDo Not Ask The Admins/Moderators' To Do Things For You!\nConsider Yourself Warned!", "I Agree", "I Disagree");
pawn Code:
if(PlayerInfo[playerid][pAgreedTerms] != 1)
{
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_MSGBOX, "Some Simple Rules You Need To Follow...", "Cheating Will Result In An IP Ban. In This Case, You Will Not Be Un-Banned!\nRespect Everyone and Everyones' Property!\nAdministators Are The Boss, Do Not Second Guess Them!\nIf You Ignore An Admin, The Admin Can/Will Ban You, It's Up To Them!\nDo Not Ask The Admins/Moderators' To Do Things For You!\nConsider Yourself Warned!", "I Agree", "I Disagree");
}