• Welcome to Vice City Multiplayer.
 

my server register command problem

Started by suhail, December 21, 2010, 02:56:58 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

suhail

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;

shivambansal