Author Topic: my server register command problem  (Read 2371 times)

0 Members and 1 Guest are viewing this topic.

Offline suhail

  • Street Thug
  • *
  • Posts: 7
    • View Profile
my server register command problem
« on: December 21, 2010, 05:56:58 pm »
plz help me sir ???

   new cmd[256], tmp[256], str[256];
   new idx;
   cmd = strtok(cmdtext, idx);
   format(file, sizeof(file), USERS_FILE, gPlayers[playerid]);

   if (strcmp(cmd, "register", true) == 0) {
      tmp = strtok(cmdtext, idx);
       if(!strlen(tmp)) SendClientMessage(playerid, COLOR_GREEN, "Usage: /c register [Password]");
       else if(dini_Exists(file)) SendClientMessage(playerid, RED, "You are already registered!");
       else {
          new string[512],IP[512];
         GetPlayerIp(playerid,IP,512);
         format(string,512,"%s",IP);
         dini_Create(file);
         dini_Set(file, "Password", encrypt(tmp));
         dini_Set(file, "Login", "1");
         dini_Set(file, "Bank", "0");
         dini_Set(file, "Cash", "0");
         dini_Set(file, "Level", "1");
         dini_Set(file, "Stats", "1");
         dini_Set(file, "Ip", string);
         SendClientMessage(playerid, COLOR_GREEN, "You have registered successfully!");
         PlayerInfo[playerid][Logged] = 1;
         PlayerInfo[playerid][Level] = 1;
         PlayerInfo[playerid][Stats] = 1;
      }
      return 1;

Offline shivambansal

  • Wiseguy
  • **
  • Posts: 52
  • VC:MP Beta Tester
    • View Profile
Re: my server register command problem
« Reply #1 on: January 07, 2011, 08:18:32 am »
ye to dimag ke uppar se nakil gayi  :P