Advertisement
Guest User

Untitled

a guest
Mar 1st, 2018
439
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.07 KB | None | 0 0
  1. public OnVehicleSpawn(vehicleid)
  2. {
  3. VehProtection(vehicleid);
  4. for(new i = 0; i < sizeof(VoziloInfo); i++)
  5. {
  6. new vFile[50];
  7. format(vFile, sizeof(vFile), AUTO_FILE, i);
  8. if(fexist(vFile))
  9. {
  10. if(vehicleid == VoziloInfo[i][vID])
  11. {
  12. for(new id = 1; id <= 17; id++)
  13. {
  14. if(VoziloInfo[i][vMod][id]!=0) { AddVehicleComponent(vehicleid,VoziloInfo[i][vMod][id]); }
  15. }
  16. if(VoziloInfo[i][vMod][0]>=0) { ChangeVehiclePaintjob(vehicleid,VoziloInfo[i][vMod][0]); }
  17. }
  18. }
  19. }
  20. return 1;
  21. }
  22.  
  23.  
  24.  
  25.  
  26.  
  27. public OnVehicleDeath(vehicleid)
  28. {
  29. for (new p, mp = GetMaxPlayers(); p != mp; p++)
  30. {
  31. if (IsPlayerConnected(p) && !IsPlayerNPC(p))
  32. {
  33. new race = GetPVarInt(p, PVAR_TAG"currentRaceID");
  34. if (race)
  35. {
  36. race -= 2;
  37. if (raceOwners[race] != INVALID_PLAYER_ID)
  38. {
  39. if (GetPVarInt(p, PVAR_TAG"currentVehID") == vehicleid)
  40. {
  41. new Float: health;
  42. GetPlayerHealth(p, health);
  43. if (health > 0)
  44. {
  45. respawnPlayer(p, race);
  46. }
  47. break;
  48. }
  49. }
  50. }
  51. }
  52. }
  53. return 1;
  54. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement