Can anybody fix this plsssssssss
#1

Hey guys

I use the lvdm3 gm.Its a small but nice script :P
What the bug is>>> The Register + Login system doesnt work...I Dont know why.I asked befor some of my friends but they hadnt any ideas. I hope u guys got some ideas and can help me plsss
Ty in advance

Код:
//---------------
/*
 * /register password
 *
 */
 dcmd_register(playerid,params[]) {

  // The command shouldn't work if we already are authed
  if (PLAYERLIST_authed[playerid]) return SystemMsg(playerid,"Already authed.");

  // The command shouldn't work if an account with this
  // nick already exists
  if (udb_Exists(PlayerName(playerid))) return SystemMsg(playerid,"Account already exists, please use '/login password'.");

  // Did he forgot the password?
  if (strlen(params)==0) return SystemMsg(playerid,"Correct usage: '/register password'");

  // We save the money to the accstate
  if (udb_Create(PlayerName(playerid),params)) return SystemMsg(playerid,"Account successfully created. Login with '/login password' now.");
  return true;

 }

/*
 * /login password
 *
 */
 dcmd_login(playerid,params[]) {

  // The command shouldn't work if we already are authed
  if (PLAYERLIST_authed[playerid]) return SystemMsg(playerid,"Already authed.");

  // The command shouldn't work if an account with this
  // nick does not exists
  if (!udb_Exists(PlayerName(playerid))) return SystemMsg(playerid,"Account doesn't exist, please use '/register password'.");

  // Did he forgot the password?
  if (strlen(params)==0) return SystemMsg(playerid,"Correct usage: '/login password'");

  if (udb_CheckLogin(PlayerName(playerid),params)) {
    // Login was correct

    // Following thing is the same like the missing SetPlayerCommand
    GivePlayerMoney(playerid,dUserINT(PlayerName(playerid)).("money")-GetPlayerMoney(playerid));

    PLAYERLIST_authed[playerid]=true;

    return SystemMsg(playerid,"Successfully authed!");
  }
  // Login was incorrect
  return SystemMsg(playerid,"Login failed!");
 }
 
 
 
//------------------------------------------------------------------------------------------------------

public OnPlayerCommandText(playerid, cmdtext[])
{
	new string[256];
	new playermoney;
	new sendername[MAX_PLAYER_NAME];
	new giveplayer[MAX_PLAYER_NAME];
	new cmd[256];
	new giveplayerid, moneys, idx, weaponid;

	cmd = strtok(cmdtext, idx);

 	dcmd(login,5,cmdtext); // because login has 5 characters
 	dcmd(register,8,cmdtext); // because register has 8 characters
	//------------------- /help
Here's the link

http://uploading.com/files/T9OK210U/lvdm3.rar.html
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)