[HELP] Assign a value to another value
#1

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
Reply
#2

in theplace you did
new histoInfo[array size]

add [32] beside array size
Reply
#3

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

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

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)