04.05.2013, 14:26
Hi everyone I'm making a command that creates a vehicle and then locks it to everyone but me. It works perfectly fine, problem is.. when I teleport to someplace far away and then teleport back, I cannot enter it.
Heres my code:
Heres my code:
Код:
//ONTOP new iVehicleObjective[MAX_VEHICLES][2]; new PersonalSVec[MAX_PLAYERS]; //IN OnPlayerCommandText if(strcmp(cmd, "/mycar", true) == 0) { new Float:X,Float:Y,Float:Z; GetPlayerPos(playerid,X,Y,Z); PersonalSVec[playerid] = CreateVehicle(522,X,Y,Z,0,0,90,1,194,-1); for(new i = 0; i < MAX_PLAYERS; i++) { if(i != playerid) { SetVehicleParamsForPlayerEx(PersonalSVec[playerid], i, 0, 1); } } return 1; } //SOMEWHERE stock SetVehicleParamsForPlayerEx(vehicleid, playerid, objective, doorslocked) { SetVehicleParamsForPlayer(vehicleid, playerid, objective, doorslocked); iVehicleObjective[vehicleid][0] = objective; iVehicleObjective[vehicleid][1] = doorslocked; } public OnVehicleStreamIn(vehicleid, forplayerid) { SetVehicleParamsForPlayer(vehicleid, forplayerid, iVehicleObjective[vehicleid][0], iVehicleObjective[vehicleid][1]); return 1; }