RoBiK 3 Odesláno: 25. Listopad, 2014 Share Odesláno: 25. Listopad, 2014 Sorry ak to je sprostosť ale tuto : Mám error: C:\Users\tRaY\Desktop\samp03z_svr_R1_win32\gamemodes\cwtgtos.pwn(17) : error 017: undefined symbol "playerid" C:\Users\tRaY\Desktop\samp03z_svr_R1_win32\gamemodes\cwtgtos.pwn(17) : error 009: invalid array size (negative, zero or out of bounds) riadok 17: new team_connect[playerid]; viem že je to volovina moja nejaka... ale čo už Link to comment Share on other sites More sharing options...
0 ZaKlaus 17 Odesláno: 25. Listopad, 2014 Share Odesláno: 25. Listopad, 2014 Vytváraš pole hodnôt o dĺžke udanej pomocou ID hráča. Tuším chceš vytvoriť skôr toto: new team_connect[MAX_PLAYERS]; 1 Link to comment Share on other sites More sharing options...
0 RoBiK 3 Odesláno: 25. Listopad, 2014 Author Share Odesláno: 25. Listopad, 2014 oK ale teraz: keď dám niekde to team_connect[MAX_PLAYERS] napr: if(team_connect[MAX_PLAYERS]==1) SetPlayerPos(playerid, 1374.1136,2204.5193,16.3672); tak už mi to vyhodí errory, mam tam ešte 3 take teamy, team_green[MAX_PLAYERS], team_away[MAX_PLAYERS], team_divak[MAX_PLAYERS], tak to už vyhodí 26 errorov , a toho tam mam dosť skoro v každom príkaze(/green) Link to comment Share on other sites More sharing options...
0 ZaKlaus 17 Odesláno: 25. Listopad, 2014 Share Odesláno: 25. Listopad, 2014 Aha, jn dáva zmysel. Netušil som v akom kontexte to myslíš. no malo by tam byť to playerid hádam, ukáž celú funkciu. EDIT: ukáž, kde deklaruješ túto premennú, ... tam by malo byť MAX_PLAYERS (alebo čokoľvek čo definuje max. počet hráčov, popr. nejaké maximum) respektíve, polopatisticky, tam kde máš new team_connect daj new team_connect[MAX_PLAYERS] čím deklaruješ pole o dĺžke max. počtu hráčov. Všade inde (predpokladajme), kde máš už len team_connect daj team_connect[playerid]; Lepšie povedané, tam, kde vyťahuješ hodnotu z pola zadávaš id prvku z pola (väčšinou pri takomto poli: playerid). Keď avšak deklaruješ pole, tak hranaté zátvorky [] slúžia na zadanie dĺžky pola, kde skôr využiješ to MAX_PLAYERS. napr. ...: new team_connect[MAX_PLAYERS] vo funkcii: if(team_connect[playerid] == 1) ... 1 Link to comment Share on other sites More sharing options...
0 Deleted User 295 Odesláno: 25. Listopad, 2014 Share Odesláno: 25. Listopad, 2014 Pri new uvadzas max hodnotu Inak index podla ktoreho chces vyberat z pola Link to comment Share on other sites More sharing options...
0 RoBiK 3 Odesláno: 25. Listopad, 2014 Author Share Odesláno: 25. Listopad, 2014 thx fakt ZaKLaus, konečne všetko funguje Link to comment Share on other sites More sharing options...
Dotaz
RoBiK 3
Sorry ak to je sprostosť ale tuto :
Mám error:
riadok 17:
viem že je to volovina moja nejaka... ale čo už
Link to comment
Share on other sites
5 odpovědí na tuto otázku
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now