Wierd loading bug.
#5

Quote:
Originally Posted by Dusan01
Посмотреть сообщение
Actually u are doing it wrong, that what is not displaying anything its because vehid parameter in enumator, you cant use real vehicle id for ID inside enumator.

Lets say when you load vehicles and count starts from 0, and its goes on... but problem is when you have lets say 5vehicles created before that loop, so you enter car id 550, and u are searching in enumator 550 ID but actually ID is 545.

So what should you do is something like this, first add in enumator vVehicle, then replace vehicle create with this
Код:
vehStat[x][vVehicle] = CreateVehicle(vehStat[x][vModelID], vehStat[x][vPosX], vehStat[x][vPosY], vehStat[x][vPosZ], vehStat[x][vPosR], vehStat[x][vColor1], vehStat[x][vColor2], -1);
and replace hook with this:
Код:
Hook:45_OnPlayerStateChange(playerid, newstate, oldstate) {
	if(newstate == PLAYER_STATE_DRIVER) {
		new baid;
		new vehid = GetPlayerVehicleID(playerid);
		new string[256];
		new veh = GetVehicleModel(vehid);
		new name[64];
		format(name, sizeof(name), "%s", VehicleNames[veh - 400]);
		for(new b = 0; b < sizeof(vehStat); b++) {
			if(veh == vehStat[b][vVehicle]) {
				baid = b;
				break;
			}
		}
		if(strfind(name, "a", true) != -1) {
			format(string, sizeof(string), "Aceasta %s este detinut de %s. Foloseste /vehinfo pentru mai multe detalii.", name, vehStat[baid][vOwnerName]);
		}
		else {
			format(string, sizeof(string), "Acest %s este detinut de %s. Foloseste /vehinfo pentru mai multe detalii.", name, vehStat[baid][vOwnerName]);
		}
		SCM(playerid, COOL_GREEN, string);
	}
}
i think that should work...
Nvm, thanks. It's working.
Reply


Messages In This Thread
Wierd loading bug. - by danielpalade - 07.07.2016, 21:39
Re: Wierd loading bug. - by Dusan01 - 08.07.2016, 12:57
Re: Wierd loading bug. - by Rdx - 08.07.2016, 13:08
Re: Wierd loading bug. - by danielpalade - 08.07.2016, 14:59
Re: Wierd loading bug. - by danielpalade - 08.07.2016, 15:10

Forum Jump:


Users browsing this thread: 2 Guest(s)