Originally Posted by https://sampwiki.blast.hk/wiki/SetVehicleParamsForPlayer
Note: From 0.3 you will have to re-apply this function when OnVehicleStreamIn is called!
|
// Will show vehicle markers for players streaming in for 0.3 new iVehicleObjective[MAX_VEHICLES][2]; public OnGameModeInit() //Or another callback { new temp = CreateVehicle(400, 0.0, 0.0, 5.0, 0.0, 0,0, -1); //ID 1 iVehicleObjective[temp][0] = 1; //Marker iVehicleObjective[temp][1] = 0; //Door Lock return 1; } 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]); }
iVehicleObjective[temp][1] = 0; //Door Lock
iVehicleObjective[temp][1] = 0; //Door Lock
public OnVehicleStreamIn(vehicleid, forplayerid) { for(new i = 0; i < MAX_PLAYERS; i++) { if(PlayerInfo[i][pPcarkey] == vehicleid && forplayerid != i) { if(CarInfo[i][cLock] == 1) { SetVehicleParamsForPlayer(vehicleid,forplayerid,0,1); } else if(CarInfo[i][cLock] == 0) { SetVehicleParamsForPlayer(vehicleid,forplayerid,0,0); } } if(PlayerInfo[i][pPcarkey2] == vehicleid && forplayerid != i) { if(CarInfo[i][cLock] == 1) { SetVehicleParamsForPlayer(vehicleid,forplayerid,0,1); } else if(CarInfo[i][cLock] == 0) { SetVehicleParamsForPlayer(vehicleid,forplayerid,0,0); } } } return 1; }
public OnVehicleStreamIn(vehicleid, forplayerid) { for(new i = 0; i < MAX_PLAYERS; i++) { if(PlayerInfo[i][pPcarkey] == vehicleid && CarInfo[vehicleid][cLock] == 1) { for(new u = 0; u < MAX_PLAYERS; u++) { SetVehicleParamsForPlayer(vehicleid, u, 0, 1); } } if(PlayerInfo[i][pPcarkey2] == vehicleid && CarInfo[vehicleid][cLock] == 1) { for(new u = 0; u < MAX_PLAYERS; u++) { SetVehicleParamsForPlayer(vehicleid, u, 0, 1); } } } return 1; }