HELP With Admin Register Command
#1

im trying to make admin command of register user
but the command doesn't work i trying everything this is what i made

Код:
	if (strcmp(cmd, "/registeru", true) ==0 )
	{
	  if(IsPlayerConnected(playerid))
	  {
	  if(PlayerInfo[playerid][pAdmin] >= 3)
	  {
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_GRAD2, "USAGE: (/registeru [FullPlayerName] [Password]");
				return 1;
			}
				format(string, sizeof(string), "%s.ini", tmp);
				new File: hFile = fopen(string, io_read);
				if (hFile)
				{
					SendClientMessage(playerid, COLOR_YELLOW, "That Username is already taken, please choose a different one.");
					fclose(hFile);
					return 1;
				}
				
							new length = strlen(cmdtext);

							while ((idx < length) && (cmdtext[idx] <= ' '))
							{
								idx++;
							}
							new offset = idx;
							new result[64];
							while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
							{
								result[idx - offset] = cmdtext[idx];
								idx++;
							}
							if(!strlen(result))
							{
								SendClientMessage(playerid, COLOR_GRAD2, "USAGE: (/registeru [FullPlayerName] [Password]");
								return 1;
							}
			new tmppass[64];
			strmid(tmppass, result, 0, strlen(cmdtext), 255);
			OnPlayerRegister(tmp,tmppass);
			return 1;
		 }
		 }
	}
Can you help me and tell me what's wrong?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)