Guest User

Posao/Rabota - Ribar

a guest
May 20th, 2020
768
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.90 KB | None | 0 0
  1. /*
  2. Napraveno za 5minuti
  3. Napravil: Tino Skripter
  4. rabota ribar
  5. */
  6. #include <a_samp>
  7. //==============================================================================
  8. #define INFO(%0,%1) SendClientMessage(%0, -1, "{CC0000}INFO:{FFFFFF} "%1)
  9. #define ZA3DTEXT 0x00F5FFFF
  10. #define COLOR_GRAD1 0xB4B5B7FF
  11. //==============================================================================
  12. new Rabota[MAX_PLAYERS] = 0;
  13. //==============================================================================
  14. public OnGameModeInit()
  15. {
  16. //==============================================================================
  17. Create3DTextLabel("{CC0000}(( {FFFFFF} RIBAR {CC0000}))\n{FFFFFF}Koristete Y",ZA3DTEXT,356.9217,-2071.0710,10.6953,15.0, 0);//RIBAR
  18. AddStaticPickup(1210, 1, 356.9217,-2071.0710,10.6953);//RIBAR
  19. //RIBAR JADICI
  20. Create3DTextLabel("{CC0000}[ RIBAR ]\n{FFFFFF}Koristete Y",ZA3DTEXT,349.8644,-2052.1431,7.8359,15.0, 0);//RIBAR
  21. AddStaticPickup(1318, 1, 349.8644,-2052.1431,7.8359);//RIBAR
  22. Create3DTextLabel("{CC0000}[ RIBAR ]\n{FFFFFF}Koristete Y",ZA3DTEXT,349.9125,-2059.6753,7.8359,15.0, 0);//RIBAR
  23. AddStaticPickup(1318, 1, 349.9125,-2059.6753,7.8359);//RIBAR
  24. Create3DTextLabel("{CC0000}[ RIBAR ]\n{FFFFFF}Koristete Y",ZA3DTEXT,349.9229,-2064.7656,7.8359,15.0, 0);//RIBAR
  25. AddStaticPickup(1318, 1, 349.9229,-2064.7656,7.8359);//RIBAR
  26. Create3DTextLabel("{CC0000}[ RIBAR ]\n{FFFFFF}Koristete Y",ZA3DTEXT,349.9342,-2067.2781,7.8359,15.0, 0);//RIBAR
  27. AddStaticPickup(1318, 1, 349.9342,-2067.2781,7.8359);//RIBAR
  28. Create3DTextLabel("{CC0000}[ RIBAR ]\n{FFFFFF}Koristete Y",ZA3DTEXT,349.9578,-2072.4248,7.8359,15.0, 0);//RIBAR
  29. AddStaticPickup(1318, 1, 349.9578,-2072.4248,7.8359);//RIBAR
  30. //==============================================================================
  31. return 1;
  32. }
  33. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  34. {
  35. //==============================================================================
  36. if(newkeys == KEY_YES)
  37. {
  38. if(IsPlayerToPoint(playerid, 5, 356.9217,-2071.0710,10.6953))
  39. {
  40. if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER) return 0;
  41. if(Rabota[playerid] == 0)
  42. {
  43. SetPlayerAttachedObject(playerid, 10,18632,6,0.079376,0.037070,0.007706,181.482910,0.000000,0.000000,1.000000,1.000000,1.000000);
  44. SendClientMessage(playerid,-1,"{CC0000}[TinoScript]{FFFFFF}Se vrabotivte kako Ribar.");
  45. SetPlayerSkin(playerid, 35);
  46. Rabota[playerid] = 10;
  47. }
  48. else
  49. {
  50. Rabota[playerid] = 0;
  51. RemovePlayerAttachedObject(playerid,10);
  52. SendClientMessage(playerid,-1,"{CC0000}[TinoScript]{FFFFFF}Dadovte otkaz od rabotata.");
  53. }
  54. }
  55. if(IsPlayerToPoint(playerid, 2, 349.8644,-2052.1431,7.8359) || IsPlayerToPoint(playerid, 2, 349.9125,-2059.6753,7.8359) || IsPlayerToPoint(playerid, 2, 349.9229,-2064.7656,7.8359) || IsPlayerToPoint(playerid, 2, 349.9342,-2067.2781,7.8359) || IsPlayerToPoint(playerid, 2, 349.9578,-2072.4248,7.8359))
  56. {
  57. if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER) return 0;
  58. if(Rabota[playerid] == 10)
  59. {
  60. Rabota[playerid] = 20;
  61. TogglePlayerControllable(playerid,0);
  62. ApplyAnimation(playerid,"SWORD","sword_block",50.0 ,0,1,0,1,1);
  63. ApplyAnimation(playerid,"SWORD","sword_block",50.0 ,0,1,0,1,1);
  64. INFO(playerid, "Ja frlivte jadicata pocekajte.. !");
  65. SetTimerEx("Ribar",30000, false, "i", playerid);
  66. } else INFO(playerid, "Ne ste vraboten kako ribar !");
  67. }
  68. }
  69. //==============================================================================
  70. return 1;
  71. }
  72. //==============================================================================
  73. forward Ribar(playerid);
  74. public Ribar(playerid)
  75. {
  76. ApplyAnimation(playerid,"SWORD","sword_block",50.0 ,0,1,0,1,1);
  77. ClearAnimations(playerid);
  78. SetPlayerSpecialAction(playerid,SPECIAL_ACTION_NONE);
  79. SendClientMessage(playerid, COLOR_GRAD1, "{CC0000}[TinoScript] | {FFFFFF}Zavrsivte so rabota!, i dobivte 5000$.");
  80. Rabota[playerid] = 10;
  81. GivePlayerMoney(playerid,5000);
  82. TogglePlayerControllable(playerid,1);
  83. return 1;
  84. }
  85. //==============================================================================
  86. forward IsPlayerToPoint(playerid, Float:radi, Float:x, Float:y, Float:z);
  87. public IsPlayerToPoint(playerid, Float:radi, Float:x, Float:y, Float:z)
  88. {
  89. if(IsPlayerConnected(playerid))
  90. {
  91. new Float:oldposx, Float:oldposy, Float:oldposz;
  92. new Float:tempposx, Float:tempposy, Float:tempposz;
  93. GetPlayerPos(playerid, oldposx, oldposy, oldposz);
  94. tempposx = (oldposx -x);
  95. tempposy = (oldposy -y);
  96. tempposz = (oldposz -z);
  97. if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
  98. {
  99. return 1;
  100. }
  101. }
  102. return 0;
  103. }
  104. //==============================================================================
Advertisement
Add Comment
Please, Sign In to add comment