error 047: array sizes do not match, or destination array is too small
error 047: array sizes do not match, or destination array is too small
dcmd_password(playerid, params[])
{
 if(gPlayerInfo[playerid][PLAYER_REGGED] != 1)
  return SendClientMessage(playerid, COLOUR_ORANGE, "ERROR: You must register first to do that! Use /register [password] to register and login.");
 else if(gPlayerInfo[playerid][PLAYER_LOGGED] == 0)
    return SendClientMessage(playerid, COLOUR_ORANGE, "ERROR: You must be logged-in to do that! Use /login [password] to login.");
 else
 {
    new tmp[30],
    tmp2[30],
    index;
    tmp = strtok(params, index);
    if(!strlen(tmp))
   return SendClientMessage(playerid, COLOUR_ORANGE, "USAGE: /password [password] [new password]");
    tmp2 = strtok(params, index);
    if(!strlen(tmp2))
    return SendClientMessage(playerid, COLOUR_ORANGE, "USAGE: /password [password] [new password]");
  new oldpassword = num_hash(tmp), newpassword = num_hash(tmp2);
    if(gPlayerInfo[playerid][PLAYER_PASS] == oldpassword)
    {
    if(oldpassword == newpassword)
      return SendClientMessage(playerid, COLOUR_ORANGE, "ERROR: Your old password can not be the same as your new password.");
   /*else if(strlen(tmp2) < gSettings[PASS_MIN] || strlen(tmp2) > gSettings[PASS_MAX])
   {
    new string[100]; format(string, sizeof(string), "ERROR: Your new password must be between %d and %d characters long!", gSettings[PASS_MIN], gSettings[PASS_MAX]);
    return SendClientMessage(playerid, COLOUR_ORANGE, string);
   }*/
    gPlayerInfo[playerid][PLAYER_PASS] = newpassword;
    new string[256]; format(string, sizeof(string), "You have successfully changed your password from \'%s\' to \'%s\'.", tmp, tmp2);
    return SendClientMessage(playerid, COLOUR_LIGHTBLUE, string);
    }
    else
    return SendClientMessage(playerid, COLOUR_ORANGE, "ERROR: Incorrect password.");
 }
}
dcmd_password(playerid, params[])
{
 if(gPlayerInfo[playerid][PLAYER_REGGED] != 1)
  return SendClientMessage(playerid, COLOUR_ORANGE, "ERROR: You must register first to do that! Use /register [password] to register and login.");
 else if(gPlayerInfo[playerid][PLAYER_LOGGED] == 0)
    return SendClientMessage(playerid, COLOUR_ORANGE, "ERROR: You must be logged-in to do that! Use /login [password] to login.");
 else
 {
    new tmp[248],
    tmp2[248],
    index;
    tmp = strtok(params, index);
    if(!strlen(tmp))
   return SendClientMessage(playerid, COLOUR_ORANGE, "USAGE: /password [password] [new password]");
    tmp2 = strtok(params, index);
    if(!strlen(tmp2))
    return SendClientMessage(playerid, COLOUR_ORANGE, "USAGE: /password [password] [new password]");
  new oldpassword = num_hash(tmp), newpassword = num_hash(tmp2);
    if(gPlayerInfo[playerid][PLAYER_PASS] == oldpassword)
    {
    if(oldpassword == newpassword)
      return SendClientMessage(playerid, COLOUR_ORANGE, "ERROR: Your old password can not be the same as your new password.");
   /*else if(strlen(tmp2) < gSettings[PASS_MIN] || strlen(tmp2) > gSettings[PASS_MAX])
   {
    new string[100]; format(string, sizeof(string), "ERROR: Your new password must be between %d and %d characters long!", gSettings[PASS_MIN], gSettings[PASS_MAX]);
    return SendClientMessage(playerid, COLOUR_ORANGE, string);
   }*/
    gPlayerInfo[playerid][PLAYER_PASS] = newpassword;
    new string[256]; format(string, sizeof(string), "You have successfully changed your password from \'%s\' to \'%s\'.", tmp, tmp2);
    return SendClientMessage(playerid, COLOUR_LIGHTBLUE, string);
    }
    else
    return SendClientMessage(playerid, COLOUR_ORANGE, "ERROR: Incorrect password.");
 }
}
tmp = strtok(params, index);
tmp2 = strtok(params, index);
Originally Posted by Galcio
Gives the same errors. The line it states the problems are at is these:
pawn Код:
|
dcmd_password(playerid, params[])
{
 if(gPlayerInfo[playerid][PLAYER_REGGED] != 1)
  return SendClientMessage(playerid, COLOUR_ORANGE, "ERROR: You must register first to do that! Use /register [password] to register and login.");
 else if(gPlayerInfo[playerid][PLAYER_LOGGED] == 0)
return SendClientMessage(playerid, COLOUR_ORANGE, "ERROR: You must be logged-in to do that! Use /login [password] to login.");
 else
 {
new tmp[64],
 tmp2[64],
 index;
tmp = strtok(params, index);
if(!strlen(tmp))
   return SendClientMessage(playerid, COLOUR_ORANGE, "USAGE: /password [password] [new password]");
tmp2 = strtok(params, index);
if(!strlen(tmp2))
 return SendClientMessage(playerid, COLOUR_ORANGE, "USAGE: /password [password] [new password]");
  new oldpassword = num_hash(tmp), newpassword = num_hash(tmp2);
if(gPlayerInfo[playerid][PLAYER_PASS] == oldpassword)
{
 if(oldpassword == newpassword)
  return SendClientMessage(playerid, COLOUR_ORANGE, "ERROR: Your old password can not be the same as your new password.");
   /*else if(strlen(tmp2) < gSettings[PASS_MIN] || strlen(tmp2) > gSettings[PASS_MAX])
   {
    new string[100]; format(string, sizeof(string), "ERROR: Your new password must be between %d and %d characters long!", gSettings[PASS_MIN], gSettings[PASS_MAX]);
    return SendClientMessage(playerid, COLOUR_ORANGE, string);
   }*/
 gPlayerInfo[playerid][PLAYER_PASS] = newpassword;
 new string[256]; format(string, sizeof(string), "You have successfully changed your password from \'%s\' to \'%s\'.", tmp, tmp2);
 return SendClientMessage(playerid, COLOUR_LIGHTBLUE, string);
}
else
 return SendClientMessage(playerid, COLOUR_ORANGE, "ERROR: Incorrect password.");
 }
}
Originally Posted by Galcio
I'm not sure what you mean by that. Could you explain what I'm supposed to do, please?
|
Originally Posted by Torran
What number did you put?
Was it 64? Like new tmp[64]; new tmp2[64]; |