08.07.2016, 15:10
Quote:
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); Код:
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); } } |