Casino

Zorg/nayJames123--Find out who is taking control of your car

Nov 2nd, 2012
944
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.84 KB | None | 0 0
  1. void checkcar(void){
  2. int vehicle, you = GetPlayerPed(), driver, netid, player;
  3. GET_CAR_CHAR_IS_USING(you, &vehicle);
  4. if (!DOES_VEHICLE_EXIST(vehicle))return;
  5. GET_DRIVER_OF_CAR(vehicle, &driver);
  6. if (driver != you)return;
  7. GET_NETWORK_ID_FROM_VEHICLE(vehicle, &netid);
  8. if (HAS_CONTROL_OF_NETWORK_ID(netid))return;
  9. for(player=0;player<16;player++){
  10. if (!IS_NETWORK_PLAYER_ACTIVE(player))continue;
  11. if (player == you)continue;
  12. if (DOES_PLAYER_HAVE_CONTROL_OF_NETWORK_ID(player, netid)){
  13. PRINT_STRING_WITH_TWO_LITERAL_STRINGS_NOW("STRING", GET_PLAYER_NAME(player), " has taken control of your car", 2500, 1);//some people seem to have trouble with this native, i never have but if you do, use the one below instead, it just shows their name, nothing else
  14. //PRINT_STRING_WITH_LITERAL_STRING_NOW("STRING", GET_PLAYER_NAME(player), 2500, 1);
  15. return;}
  16. }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment