SA-MP Forums Archive
Can anyone tell me why is this happening! - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Can anyone tell me why is this happening! (/showthread.php?tid=380584)



Can anyone tell me why is this happening! - Glint - 26.09.2012

Hello guys just check this code :
pawn Код:
PlayerInfo[playerid][Password] = file_dGetStr(UserPath(playerid), "Password");
I am getting player's password on connect and then saving it into his enum the "dGetStr" is a direct line reading method (i am using Southclaw's INI system).

Now my problem is when i compile i get this
Код:
error 047: array sizes do not match, or destination array is too small
on that specific line


Re: Can anyone tell me why is this happening! - XtremeR - 26.09.2012

use format
pawn Код:
format(PlayerInfo[playerid][Password] = file_dGetStr(UserPath(playerid), "Password"));
let me know if any errors


Re: Can anyone tell me why is this happening! - Glint - 26.09.2012

Quote:
Originally Posted by XtremeR
Посмотреть сообщение
use format
pawn Код:
format(PlayerInfo[playerid][Password] = file_dGetStr(UserPath(playerid), "Password"));
let me know if any errors
You can't use enum variables inside format

Any other ideas ?


Re: Can anyone tell me why is this happening! - XtremeR - 26.09.2012

can i see your defines please?


Re: Can anyone tell me why is this happening! - Vince - 26.09.2012

The cell size of PlayerInfo[playerid][Password] must be equal or bigger to the cell size that is returned by the function. If you don't know the cell size returned by the function, then look it up in the include.


Re: Can anyone tell me why is this happening! - Glint - 26.09.2012

I only have one define which is the USER_PATH define.

EDIT: @Vince : Thanks it worked apparently the size in the include is 256 and i am using 129 however when i changed the password length in my enum to 256 it compiled without errors but since i am using Whirlpool (Which hashes passwords with 128 characters + one null terminator) so i don't want to use a cell 256 big in size for that it is a performance drawback.

However can i do it any other way ?