Advertisement
Guest User

Untitled

a guest
Apr 10th, 2019
247
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.06 KB | None | 0 0
  1. /*===================================================================
  2. Ghost Town on the engine (Grad Duhova )
  3. -» Autor : Nodze ( Dzenan Levic )
  4. -» Deskripcija : Plamen motora, poput duhova jahača
  5. ====================================================================*/
  6. #include <a_samp>
  7. #include < YSI\y_ini >
  8. #include < YSI\y_commands >
  9. //Kod ostalih Definicija.
  10. #define SCM SendClientMessage
  11.  
  12. //Dodas gdje su ti ostali New-ovi
  13. new GhostTown[MAX_PLAYERS][3];
  14.  
  15. //dodas u OnGameModeIni
  16. public OnFilterScriptInit()
  17.  
  18. return print("Grad Duhova na motoru UCITANO!");
  19.  
  20. //dodas u OnGameModeExit
  21. public OnFilterScriptExit()
  22. {
  23. for(new i=0; i < MAX_PLAYERS+1; i++){
  24. if(GhostTown[i][0]){
  25. DestroyObject(GhostTown[i][0]);
  26. DestroyObject(GhostTown[i][1]);
  27. DestroyObject(GhostTown[i][2]);
  28. GhostTown[i][0] = 0;
  29. }
  30. }
  31. return print("Grad Duhova na motoru NIJE UCITALO!");
  32. }
  33. //Ovo ide gdje su ti ostale komande, Prilagodi svojoj skripti komandu
  34. YCMD:motorduh(playerid, params[], help)
  35. {
  36. #pragma unused help
  37. // if(PlayerInfo[playerid][yAdministrator] >= 1 || PlayerInfo[playerid][yVIP] >= 3) return SCM(playerid,-1,""nodze_blue"Ghost Town"nodze_siva"Samo Administrator & Vip!"); //PRILAGODI SVOJOJ SKRIPTI
  38. if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, 0xFF0000AA, "[GHOST TOWN] {FFFFFF}Morate biti u odredjenim motociklu: NRG - 500!");
  39. if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessage(playerid, 0xFF0000AA, "[GHOST TOWN] {FFFFFF}Moras bit u motociklu!");
  40. if(GetVehicleModel(GetPlayerVehicleID(playerid)) != 522) return SendClientMessage(playerid, 0xFF0000AA, "[GHOST TOWN] {FFFFFF}Moras bit u NRG-500 motorbike!");
  41.  
  42. if(GhostTown[playerid][0]){
  43. DestroyObject(GhostTown[playerid][0]);
  44. DestroyObject(GhostTown[playerid][1]);
  45. DestroyObject(GhostTown[playerid][2]);
  46. GhostTown[playerid][0] = 0;
  47. return 1;
  48. }
  49. new Float:vh;
  50. GetVehicleHealth(GetPlayerVehicleID(playerid), vh);
  51. if(vh < 250) return SendClientMessage(playerid, 0xFF0000AA, "[GHOST TOWN] {FFFFFF}Prvo popravi svoj motocikl!");
  52. GhostTown[playerid][0] = CreateObject(18689, 0.0, 0.0, 0.0, 0.0, 0.0, 256.0);
  53. GhostTown[playerid][1] = CreateObject(18689, 0.0, 0.0, 0.0, 0.0, 0.0, 256.0);
  54. GhostTown[playerid][2] = CreateObject(18693, 0.0, 0.0, 0.0, 0.0, 0.0, 256.0);
  55. AttachObjectToVehicle(GhostTown[playerid][0], GetPlayerVehicleID(playerid), 0.0, 0.6, -1.7, 0.0, 0.0, 0.0);
  56. AttachObjectToVehicle(GhostTown[playerid][1], GetPlayerVehicleID(playerid), 0.0, -1.4, -1.7, 0.0, 0.0, 0.0);
  57. AttachObjectToPlayer(GhostTown[playerid][2], playerid, 0.0, -0.01, -0.9, 0.0, 0.0, 0.0);
  58. ChangeVehicleColor(GetPlayerVehicleID(playerid), 0, 0);
  59. return 1;
  60. }
  61. // return 0;
  62. //}
  63. public OnPlayerStateChange(playerid, newstate, oldstate)
  64. {
  65. if(oldstate == PLAYER_STATE_DRIVER && newstate == PLAYER_STATE_ONFOOT){
  66. if(GhostTown[playerid][0]){
  67. DestroyObject(GhostTown[playerid][0]);
  68. DestroyObject(GhostTown[playerid][1]);
  69. DestroyObject(GhostTown[playerid][2]);
  70. GhostTown[playerid][0] = 0;
  71. }
  72. }
  73. if(oldstate == PLAYER_STATE_DRIVER && newstate == PLAYER_STATE_WASTED){
  74. if(GhostTown[playerid][0]){
  75. DestroyObject(GhostTown[playerid][0]);
  76. DestroyObject(GhostTown[playerid][1]);
  77. DestroyObject(GhostTown[playerid][2]);
  78. GhostTown[playerid][0] = 0;
  79. }
  80. }
  81. return 1;
  82. }
  83. public OnPlayerConnect(playerid)
  84. {
  85. GhostTown[playerid][0] = 0;
  86. GhostTown[playerid][1] = 0;
  87. GhostTown[playerid][2] = 0;
  88. }
  89. public OnPlayerDisconnect(playerid, reason)
  90. {
  91. if(GhostTown[playerid][0]){
  92. DestroyObject(GhostTown[playerid][0]);
  93. DestroyObject(GhostTown[playerid][1]);
  94. DestroyObject(GhostTown[playerid][2]);
  95. GhostTown[playerid][0] = 0;
  96. }
  97. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement