Jump to content
  • 0

pomoc Jak opravit 1 error


mourison

Dotaz

Zdravím, háže mi to nepříjemný error :d :/

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

4 odpovědí na tuto otázku

Recommended Posts

  • 0

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 by _Martin_
Link to comment
Share on other sites

  • 0

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

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