mourison 0 Odesláno: 20. Leden, 2015 Share Odesláno: 20. Leden, 2015 Zdravím, háže mi to nepříjemný error :/ C:\Users\Zuzana\Desktop\SAMP - 0.3z (Server)\gamemodes\server.pwn(2636) : error 032: array index out of bounds (variable "majitel") if(!dini_Exists(cesta2)) { //neexistuje } else { new majitel[256]; majitel = dini_Get(cesta2, "Majitel"); if(PlayerName(playerid) == majitel[256]) // zde error { SCM(playerid, zelena, "Nastoupil jsi do svého auta"); } else { RemovePlayerFromVehicle(playerid); SCM(playerid, zelena, "Toto auto není tvoje"); } } Link to comment Share on other sites More sharing options...
0 _Martin_ 10 Odesláno: 20. Leden, 2015 Share Odesláno: 20. Leden, 2015 (upraveno) Predpokladám, že majitel je nick hráča, ktorý môže mať maximálne 25 znakov, takže si ten new majitel[256]; zmeň na new majitel[MAX_PLAYER_NAME];. Ďalej string neporovnávaš == ale strcmp. Edited 20. Leden, 2015 by _Martin_ Link to comment Share on other sites More sharing options...
0 eXot 18 Odesláno: 20. Leden, 2015 Share Odesláno: 20. Leden, 2015 format(majitel, sizeof(majitel), "%s", dini_Get(cesta2, "Majitel")); Link to comment Share on other sites More sharing options...
0 mourison 0 Odesláno: 20. Leden, 2015 Author Share Odesláno: 20. Leden, 2015 error 033: array must be indexed (variable "PlayerName") Link to comment Share on other sites More sharing options...
0 LYRIcS 88 Odesláno: 20. Leden, 2015 Share Odesláno: 20. Leden, 2015 if(!dini_Exists(cesta2)){ //neexistuje}else if(strcmp(PlayerName(playerid), dini_Get(cesta2, "Majitel"), false) == 0) // zde error{ SCM(playerid, zelena, "Nastoupil jsi do svého auta");}else{ RemovePlayerFromVehicle(playerid); SCM(playerid, zelena, "Toto auto není tvoje");} Link to comment Share on other sites More sharing options...
Dotaz
mourison 0
Zdravím, háže mi to nepříjemný error :/
Link to comment
Share on other sites
4 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