Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #include <zcmd>
- new pLightObject[MAX_PLAYERS];
- new pLightStatus[MAX_PLAYERS];
- new vUndercover [MAX_VEHICLES];
- //vUndercover[vehicleid] = false;
- //Call that when you destroy the undercover vehicle
- COMMAND:vehicle(playerid, params[])
- {
- new
- Vehicle,
- Float:x,
- Float:y,
- Float:z,
- Float:a;
- GetPlayerPos(playerid,x,y,z);
- GetPlayerFacingAngle(playerid,a);
- x += (5 * floatsin(-a, degrees));
- y += (5 * floatcos(-a, degrees));
- Vehicle = CreateVehicle(415,x,y,z + 3.0,a, -1, -1, 50000);
- vUndercover[Vehicle] = true;
- PutPlayerInVehicle(playerid, Vehicle, 0);
- SendClientMessage(playerid, 0xFFFFFF, "You went Undercover.");
- return 1;
- }
- public OnPlayerKeyStateChange(playerid,newkeys,oldkeys)
- {
- if((newkeys & 2) == (2))
- {
- new
- v = GetPlayerVehicleID(playerid);
- if(vUndercover[v])
- {
- if(!pLightStatus[playerid])
- {
- pLightObject[playerid] = CreateObject(18646, 0.0001, 0.0200, -16.0000, 0, 0, 0);
- AttachObjectToVehicle(pLightObject[playerid], v, -0.34, -0.17, 0.64, -2.00, 0.00, 4.00);
- pLightStatus[playerid] = true;
- return 1;
- }
- else
- {
- DestroyObject(pLightObject[playerid]);
- pLightStatus[playerid] = false;
- return 1;
- }
- }
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement