SA-MP Forums Archive
How to add 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: How to add rules? (/showthread.php?tid=91475)



How to add rules? - acok97 - 15.08.2009

OK , Thanks people for the anims , now I want to add rules, could somebody teach me how to do that ?


Re: How to add rules? - Abernethy - 15.08.2009

Extremely Simple piece of code.
pawn Code:
SendClientMessage(playerid, YOUR_COLOR, "The message you want to display goes here!");



Re: How to add rules? - Adil - 15.08.2009

You should tell us how you want your rules to show up ? when they connect ? or when they spawn ? or when they /register ? please provide us with some description before asking.

Regards, Adil.


Re: How to add rules? - acok97 - 15.08.2009

I want it when they spawn @ Pakistan Cool Boy
PS. If it could to freeze everything , so when you spawn it freezes and then the rules show up


Re : How to add rules? - Naruto_Emilio - 13.05.2011

Then put the code under, OnPlayerSpawn
pawn Code:
SendClientMessage(playerid, AEB404, "Rule Number1");
SendClientMessage(playerid, AEB404, "Rule Number2");
SendClientMessage(playerid, AEB404, "Rule Number3");
SendClientMessage(playerid, AEB404, "Rule Number4");
SendClientMessage(playerid, AEB404, "Rule Number5");



Re: How to add rules? - Biesmen - 13.05.2011

Or, more efficient:
pawn Code:
public OnPlayerSpawn(playerid)
{
   TogglePlayerControllable(playerid, false);
   ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Rules here", "Understood", "Cancel");
   return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
   if(dialogid == 1)
   {
      if(!response) // If he clicked on "Cancel"
      {
         Kick(playerid); // It will kick him
         return 1;
      } else {
         TogglePlayerControllable(playerid, true);
      }
      return 1;
   }
   return 0;
}