Jump to content
Autentificarea cu Google și Facebook nu mai este disponibilă. ×

Question

Posted

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");   

1 answer to this question

Recommended Posts

  • 0
Posted

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;
s.a.m.d.

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]);

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • 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.