XADRENALINEIX

X ADRENALINE IX's Lock & Unlock Net Players Vehicle Door's

May 18th, 2013
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.72 KB | None | 0 0
  1. if(DOES_CHAR_EXIST(players[index].ped)){
  2. if(IS_CHAR_IN_ANY_CAR(players[index].ped)){
  3. int pveh,nvid;
  4. GET_CAR_CHAR_IS_USING(players[index].ped,&pveh);
  5. GET_NETWORK_ID_FROM_VEHICLE(pveh,&nvid);
  6. REQUEST_CONTROL_OF_NETWORK_ID(nvid);
  7. LOCK_CAR_DOORS(pveh,4);
  8. print("Car Doors Locked");
  9. }
  10. else print("Player needs to be in a vehicle");
  11. }
  12. return;
  13. }
  14. }
  15.  
  16. //Add in else function if you would like Lock & Unlock as one function.
  17.  
  18. if(DOES_CHAR_EXIST(players[index].ped)){
  19. if(IS_CHAR_IN_ANY_CAR(players[index].ped)){
  20. int pveh,nvid;
  21. GET_CAR_CHAR_IS_USING(players[index].ped,&pveh);
  22. GET_NETWORK_ID_FROM_VEHICLE(pveh,&nvid);
  23. REQUEST_CONTROL_OF_NETWORK_ID(nvid);
  24. LOCK_CAR_DOORS(pveh,1);
  25. print("Car Doors Unlocked");
  26. }
  27. }
  28. return;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment