Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- enum carData {
- carID,
- carExists,
- carModel,
- carOwner,
- Float:carPos[4],
- carColor1,
- carColor2,
- carPaintjob,
- carLocked,
- carMods[14],
- carImpounded,
- carImpoundPrice,
- carFaction,
- carWeapons[5],
- carAmmo[5],
- carVehicle,
- carSign[32]
- };
- ////////////////////
- Car_GetCount(playerid)
- {
- new
- count = 0;
- for (new i = 0; i != MAX_DYNAMIC_CARS; i ++)
- {
- if (CarData[i][carExists] && CarData[i][carOwner] == PlayerData[playerid][pID])
- {
- count++;
- }
- }
- return count;
- }
- //////////////////////
- Car_IsOwner(playerid, carid)
- {
- if (!PlayerData[playerid][pLogged] || PlayerData[playerid][pID] == -1)
- return 0;
- if ((CarData[carid][carExists] && CarData[carid][carOwner] != 0) && CarData[carid][carOwner] == PlayerData[playerid][pID])
- return 1;
- return 0;
- }
- ////////////////////
- if (Car_IsOwner(playerid, id) || (PlayerData[playerid][pFaction] != -1 && CarData[id][carFaction] == GetFactionType(playerid)))
- {
- if (!CarData[id][carLocked])
- {
- CarData[id][carLocked] = true;
- Car_Save(id);
- ShowPlayerFooter(playerid, "You have ~r~locked~w~ the vehicle!");
- PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
- SetVehicleParamsEx(CarData[id][carVehicle], engine, lights, alarm, 1, bonnet, boot, objective);
- }
- else
- {
- CarData[id][carLocked] = false;
- Car_Save(id);
- ShowPlayerFooter(playerid, "You have ~g~unlocked~w~ the vehicle!");
- PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
- SetVehicleParamsEx(CarData[id][carVehicle], engine, lights, alarm, 0, bonnet, boot, objective);
- }
- }
- }
- else SendErrorMessage(playerid, "You are not in range of anything you can lock.");
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement