SA-MP Forums Archive
[HELP] Assign a value to another value - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [HELP] Assign a value to another value (/showthread.php?tid=235953)



[HELP] Assign a value to another value - Vukilore - 06.03.2011

pawn Код:
new nomdelarme[32];
    if(dialogid == DialogIDArmurerie)
    {
        if(response)
        {
        switch( listitem )
        {
            case 0:
            {
             if(MatHQ >= 400) //Ak47
             {
                GetWeaponName(30, nomdelarme, sizeof(nomdelarme));
                HistoInfo[HistoArme] = nomdelarme;
                HistoInfo[HistoNom] = sendername;
                sauverhisto();
                GivePlayerWeapon(playerid,30,200);
                MatHQ = MatHQ-400;
             }
Код:
C:\Documents and Settings\HP_Propriйtaire\Bureau\GTASERVER\Nouveau dossier (2)\Zombie 0.3c FF\gamemodes\zm.pwn(2245) : error 047: array sizes do not match, or destination array is too small
C:\Documents and Settings\HP_Propriйtaire\Bureau\GTASERVER\Nouveau dossier (2)\Zombie 0.3c FF\gamemodes\zm.pwn(2246) : error 047: array sizes do not match, or destination array is too small
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Errors.
I would assign the value HistoInfo[HistoArme] to a weapon name (here AK47)
and i would assign the value HistoInfo[HistoNom] to a sender name.

But when i compile it, it doesn't work.
Can you help me please? thanks


Re: [HELP] Assign a value to another value - THE_KNOWN - 06.03.2011

in theplace you did
new histoInfo[array size]

add [32] beside array size


Re: [HELP] Assign a value to another value - Mean - 06.03.2011

Increase the size, meaning [ 32 ] is too small, try [ 128 ] or [ 255 ] or even more.


Re: [HELP] Assign a value to another value - THE_KNOWN - 06.03.2011

thats a complete waste of resources. i dont think theres a gun with a very long name for 128


Re: [HELP] Assign a value to another value - Mean - 06.03.2011

I know, but sometimes you need to add a huge string. Example: strtok, sometimes you don't even need 20 cells, but you need to use 256 because it will give you error.