Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * Mini-INC
- * VehicleParams Automatic Fixxer
- * (c) Copyright 2010-2011 by FoxHound
- *
- * @author : FoxHound aka PSPgamer_10
- * @date : 03 November 2010
- * @version : v 0.1
- * @function_ : fixxes SetVehicleParams automatically
- *
- * This file is provided as is (no warranties).
- *
- */
- #include <a_samp>
- #define PLUG_n_PLAY //Uncomment this (remove the '//' before '#define', if you wanna use the Plug'n'Play Function, then you must ONLY write the name of this Script in your GameMode/FilterScript
- forward VPF_OnVehicleStreamIn(vehicleid, forplayerid);
- forward VPF_SetVehicleParamsForPlayer(vehicleid,playerid,objective,doorslocked);
- forward SetVehicleParamsForAll(vehicleid,objective,doorslocked);
- new vehP_objective[MAX_VEHICLES][MAX_PLAYERS],
- vehP_doorslocked[MAX_VEHICLES][MAX_PLAYERS];
- public VPF_SetVehicleParamsForPlayer(vehicleid,playerid,objective,doorslocked) //New Function
- {
- vehP_objective[vehicleid][playerid] = objective;
- vehP_doorslocked[vehicleid][playerid] = doorslocked;
- if(IsVehicleStreamedIn(vehicleid,playerid))
- {
- SetVehicleParamsForPlayer(vehicleid,playerid,objective,doorslocked);
- }
- return 1;
- }
- public SetVehicleParamsForAll(vehicleid,objective,doorslocked)
- {
- for(new i=0;i<GetMaxPlayers();i++)
- {
- vehP_objective[vehicleid][i] = objective;
- vehP_doorslocked[vehicleid][i] = doorslocked;
- if(IsVehicleStreamedIn(vehicleid,i))
- {
- SetVehicleParamsForPlayer(vehicleid,i,objective,doorslocked);
- }
- }
- return 1;
- }
- public VPF_OnVehicleStreamIn(vehicleid, forplayerid) //Callback Function
- {
- SetVehicleParamsForPlayer(vehicleid,forplayerid,vehP_objective[vehicleid][forplayerid],vehP_doorslocked[vehicleid][forplayerid]);
- #if defined PLUG_n_PLAY
- return CallLocalFunction("OnVehicleStreamIn","ii",vehicleid,forplayerid);
- #else
- return 1;
- #endif
- }
- #if defined PLUG_n_PLAY
- #define OnVehicleStreamIn VPF_OnVehicleStreamIn
- #define SetVehicleParamsForPlayer VPF_SetVehicleParamsForPlayer
- #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement