Advertisement
rati555

1st Person Vehicle Driving [0.3e] V0.2

Apr 8th, 2012
2,833
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.28 KB | None | 0 0
  1. //=========================== 1st Person Vehicle Driving By rati555 || V0.2 ===========================//
  2. #include <a_samp>
  3. #include <zcmd>
  4. #define FILTERSCRIPT
  5. new obj[MAX_PLAYERS];
  6. public OnFilterScriptInit()
  7. {
  8.         print(" 1st Person Vehicle Driving by Rati555");
  9.         return 1;
  10. }
  11.  
  12. public OnFilterScriptExit()
  13. {
  14. return 1;
  15. }
  16. public OnPlayerExitVehicle(playerid,vehicleid)
  17. {
  18. if(GetPVarInt(playerid,"used") == 1)
  19. {
  20. SetPVarInt(playerid,"used",0);
  21. SetCameraBehindPlayer(playerid);
  22. DestroyPlayerObject(playerid,obj[playerid]);
  23. }
  24. return 1;
  25. }
  26.  
  27. CMD:changeview(playerid,params[])
  28. {
  29. #pragma unused params
  30. if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,-1,"You must be in a vehicle to use this cmd");
  31. if(GetPVarInt(playerid,"used") == 0)
  32. {
  33. new p = GetPlayerVehicleID(playerid);
  34. obj[playerid] = CreatePlayerObject(playerid,19300, 0.0000, -1282.9984, 10.1493, 0.0000, -1, -1, 100);
  35. AttachPlayerObjectToVehicle(playerid,obj[playerid],p,-0.314999, -0.195000, 0.510000, 0.000000, 0.000000, 0.000000);
  36. AttachCameraToPlayerObject(playerid,obj[playerid]);
  37. SetPVarInt(playerid,"used",1);
  38. }
  39. else if(GetPVarInt(playerid,"used") == 1)
  40. {
  41. SetCameraBehindPlayer(playerid);
  42. DestroyPlayerObject(playerid,obj[playerid]);
  43. SetPVarInt(playerid,"used",0);
  44. }
  45. return 1;
  46. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement