Jump to content
  • 0

"array must be indexed"



Salutare! Incerc sa optimizez gamemode-ul chars si am dat de o problema de care nu am mai dat pana acum.

Chars.pwn(13542) : error 033: array must be indexed (variable "componenets")
Chars.pwn(13543) : error 033: array must be indexed (variable "Mods")
Chars.pwn(13544) : error 033: array must be indexed (variable "coordonate")
Pawn compiler 3.10.8              Copyright (c) 1997-2006, ITB CompuPhase

3 Errors.

13542        componenets = cache_get_field_content_int(20, "Components");                                                                               
13543        Mods = cache_get_field_content_int(50, "Mods");
13544        coordonate == cache_get_field_content_int(50, "Cordonate");   

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

Bazat ce ai oferit cel mai probabil toate aceste trei variabile sunt de fapt array-uri

new componenets[..];
new Mods[..];
new coordonate[..];

Iar ca sa atribui o valoarea unui array va trebui sa te folosesti de un index

Mods[0] = valoare;
Mods[1] = altaValoare;

Doar ca de asemenea presupun, din lipsa de informatii, ca in baza de date probabil ai salvate cele 3 date pe care vrei sa le preiei poate ceva de genul (care e un design destul de rau)

30 | 40 | 23 | 100 ...

Care din ce stiu/amintesc folosesti sscanf ca sa extragi ce ai nevoie, poate ceva asemenator cu

sscanf("23|30|40", "p<|>iii", Mods[0], Mods[1], Mods[2]);
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.