Don't like ads? PRO users don't see any ads ;-)
Guest

dialog help

By: a guest on Aug 3rd, 2012  |  syntax: None  |  size: 1.80 KB  |  hits: 18  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  2. {
  3. switch(dialogid)
  4.     {
  5.                 case DIALOG_REGISTER:
  6.         {
  7.                         new dialog[128];{
  8.                         if(inputtext[0] < 5) return SCM(playerid, COLOR_RED,"Your password must be longer than 4 characters!"); ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD,""COL_RED"Password must be longer than 4 characters!", dialog, "Register", "Exit");}
  9.                         if(response)
  10.             {
  11.  
  12.                                 new
  13.                     string[179],pFile[35];
  14.  
  15.                                 format(pFile, 35, Player_File, GetName(playerid));
  16.  
  17.                                 new
  18.                                 INI:UserFile = INI_Open(pFile);
  19.  
  20.                                 INI_WriteInt(UserFile, "Password", udb_hash(inputtext));
  21.                                 INI_WriteInt(UserFile, "Admin", 0);
  22.                                 INI_WriteInt(UserFile, "Money", START_MONEY);
  23.                                 INI_WriteInt(UserFile, "Score", 0);
  24.                                     INI_WriteInt(UserFile, "Skin", SKIN_ID);
  25.                                     INI_WriteInt(UserFile, "Warn", 0);
  26.                                     INI_WriteInt(UserFile, "VIP", 0);
  27.                                     INI_WriteInt(UserFile, "B_Time", 0);
  28.                                     INI_WriteInt(UserFile, "B_Till", 0);
  29.                                 INI_Close(UserFile);
  30.  
  31.                                 SetPVarInt(playerid, "Registered", 1);
  32.                                 SetPVarInt(playerid, "Logged", 1);
  33.                                 SpawnPlayer(playerid);
  34.  
  35.                     format(string, 125, ""COL_YELLOW"Name: "COL_WHITE"%s "COL_YELLOW"Password: "COL_WHITE"%s "COL_YELLOW"succesfuly registerd", GetName(playerid), inputtext);
  36.                     SCM(playerid, 0x46BA29FF, string);
  37.                     ShowPlayerDialog(playerid,100,DIALOG_STYLE_MSGBOX,"Rules","1.Cheating and hacking - Permban\n2./ask if you want help.\n3Disrespect will end in a ban.\nOnly English in chat.\nDifferent language in chat will end in ban.\n4.Respect All Players!","Agree","Deny");
  38.                     SpawnPlayer(playerid);
  39.             }
  40.             else Kick(playerid);
  41.         }