Advertisement
Guest User

FS CAZADOR

a guest
Jan 19th, 2014
1,173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 6.73 KB | None | 0 0
  1. /* FS CREADO POR STRIKE
  2.  
  3. BRUNO DA SILVA SCRIPT DETECTAR DISPARO*/
  4.  
  5.  
  6.  
  7.  
  8. #include a_samp
  9. #include zcmd
  10. #include Dini
  11.  
  12. #define TAMANHO_OBJETO      1.4
  13. #define Rojo                0xa80707FF
  14.  
  15. new Float:X_OBJETO[10][1] =
  16. {
  17.     {-1687.25427},
  18.     {-1639.22363},
  19.     {-1513.02942},
  20.     {-1769.84949},
  21.     {-1720.98523},
  22.     {-1411.85046},
  23.     {-1241.92603},
  24.     {-1353.24121},
  25.     {-1487.88245},
  26.     {-1610.81677}
  27. };
  28.  
  29. new Float:Y_OBJETO[10][1] =
  30. {
  31.     {-2168.04907},
  32.     {-2314.11646},
  33.     {-2167.67188},
  34.     {-2338.39404},
  35.     {-2021.65540},
  36.     {-2038.05493},
  37.     {-2334.24463},
  38.     {-2418.34351},
  39.     {-2570.38428},
  40.     {-2694.43848}
  41. };
  42.  
  43. new Float:BambisObj[10][3] =
  44. {
  45.     {-1687.25427, -2168.04907, 38.27590},
  46.     {-1639.22363, -2314.11646, 59.25200},
  47.     {-1513.02942, -2167.67188, 0.51030},
  48.     {-1769.84949, -2338.39404, 44.43521},
  49.     {-1720.98523, -2021.65540, 71.04913},
  50.     {-1411.85046, -2038.05493, 0.60150},
  51.     {-1241.92603, -2334.24463, 18.44890},
  52.     {-1353.24121, -2418.34351, 31.89130},
  53.     {-1487.88245, -2570.38428, 71.90640},
  54.     {-1610.81677, -2694.43848, 48.01360}
  55. };
  56.  
  57. new Bambi[MAX_PLAYERS];
  58.  
  59. enum PlayerData
  60. {
  61.     pCazador,
  62. }
  63. new PlayerInfo[MAX_PLAYERS][PlayerData];
  64.  
  65. public OnFilterScriptInit()
  66. {
  67.     CreatePickup(1239, 1, -1634.8252,-2244.1931,31.4766);
  68.     Create3DTextLabel("{F3FC01}Empleo: {F70636}Cazador\n{E3F706}Use {F70636}/cazar\n{E3F706}Para comenzar a trabajar", 0x008080FF, -1634.8252,-2244.1931,31.4766, 10.0, 0, 0);
  69.     //map casa
  70.     CreateObject(1736, -1628.80774, -2239.59741, 33.07220,   0.00000, 0.00000, -90.00000);
  71.     CreateObject(1828, -1634.97388, -2239.17261, 30.45190,   0.00000, 0.00000, 0.00000);
  72.     CreateObject(1703, -1636.20154, -2232.75757, 30.43860,   0.00000, 0.00000, 2.96170);
  73.     CreateObject(1825, -1630.96948, -2236.40820, 30.45860,   0.00000, 0.00000, 0.00000);
  74.     CreateObject(2166, -1637.07458, -2247.62500, 30.47040,   0.00000, 0.00000, 0.00000);
  75.     CreateObject(2172, -1632.39795, -2247.39893, 30.45040,   0.00000, 0.00000, 181.22121);
  76.     CreateObject(1703, -1637.53430, -2236.92017, 30.43860,   0.00000, 0.00000, 90.00000);
  77.     CreateObject(2209, -1635.45422, -2236.11133, 30.31440,   0.00000, 0.00000, 90.00000);
  78.     return 1;
  79. }
  80.  
  81. main()
  82. {
  83.     return 1;
  84. }
  85.  
  86. public OnPlayerConnect(playerid)
  87. {
  88.     new file[80];
  89.     format(file, sizeof(file),"Cazador/%s.ini", pName(playerid));
  90.     if(dini_Exists(file))
  91.     {
  92.         PlayerInfo[playerid][pCazador] = dini_Int(file,"Cazador");
  93.     }
  94.     else if(!dini_Exists(file))
  95.     {
  96.         dini_Create(file);
  97.         dini_IntSet(file,"Cazador",PlayerInfo[playerid][pCazador] = 0);
  98.     }
  99.     return 1;
  100. }
  101.  
  102. public OnPlayerDisconnect(playerid, reason)
  103. {
  104.     new file[256];
  105.     format(file, sizeof(file),"Cazador/%s.ini", pName(playerid));
  106.     dini_IntSet(file,"Cazador",PlayerInfo[playerid][pCazador]);
  107.     return 1;
  108. }
  109.  
  110. public OnPlayerSpawn(playerid)
  111. {
  112.     GivePlayerWeapon(playerid, 32, 400);
  113.     return 1;
  114. }
  115.  
  116. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  117. {
  118.     new rand = random(sizeof(X_OBJETO));
  119.     new rand3 = random(sizeof(BambisObj));
  120.     new rand2 = random(sizeof(Y_OBJETO));
  121.     if((newkeys & KEY_FIRE || oldkeys & KEY_FIRE ) &&  IsPlayerInRangeOfPoint(playerid, 200.0 , X_OBJETO[rand][0] , Y_OBJETO[rand2][0] , 0.0))
  122.     {
  123.  
  124.         static
  125.             Float:xPos,
  126.             Float:yPos,
  127.             Float:zPos,
  128.             Float:distancia,
  129.             Float:aPos;
  130.  
  131.         GetPlayerPos(playerid, xPos, yPos, zPos);
  132.         GetPlayerFacingAngle(playerid, aPos);
  133.  
  134.         distancia = floatsqroot(floatpower(floatabs(xPos-X_OBJETO[rand][0]), 2) + floatpower(floatabs(yPos-Y_OBJETO[rand2][0]), 2));
  135.         if(distancia <  100.0)
  136.         {
  137.             xPos += (distancia * floatsin(-aPos, degrees)),
  138.             yPos += (distancia * floatcos(-aPos, degrees));
  139.             distancia = floatsqroot(floatpower(floatabs(xPos-X_OBJETO[rand][0]), 2) + floatpower(floatabs(yPos-Y_OBJETO[rand2][0]), 2));
  140.             SendClientMessage(playerid,Rojo,"[EXELENTE]: {F6F8F5}Mataste un venado y ganaste $1.000");
  141.             DestroyObject(Bambi[playerid]);
  142.             GivePlayerMoney(playerid, 1000);
  143.             Bambi[playerid] = CreateObject(19315, BambisObj[rand3][0], BambisObj[rand3][1], BambisObj[rand3][2], 0.0, 0.0, 0.0);
  144.         }
  145.     }
  146.     return 1;
  147. }
  148.  
  149. CMD:cazar(playerid, params[])
  150. {
  151.     new rand3 = random(sizeof(BambisObj));
  152.     if(IsPlayerInRangeOfPoint(playerid, 1.0, -1634.8252,-2244.1931,31.4766))
  153.     {
  154.     if(PlayerInfo[playerid][pCazador] == 0){}else return SendClientMessage(playerid,Rojo,"Error: Ya tienes este empleo");
  155.     PlayerInfo[playerid][pCazador] = 1;
  156.     SendClientMessage(playerid,Rojo,"{FD0303}||--------------------------------------------------------------------");
  157.     SendClientMessage(playerid,Rojo,"{FD0303}||------------------{2DFD03}FELICIDADES TIENES UN NUEVO EMPLEO{FD0303}----------------");
  158.     SendClientMessage(playerid,Rojo,"{FD0303}||--------------------------------{2DFD03}CAZADOR{FD0303}-----------------------------");
  159.     SendClientMessage(playerid,Rojo,"{FD0303}||--------------------------------------------------------------------");
  160.     SendClientMessage(playerid,Rojo,"[INFO]: {F6F8F5}Busca y captura venados");
  161.     Bambi[playerid] = CreateObject(19315, BambisObj[rand3][0], BambisObj[rand3][1], BambisObj[rand3][2], 0.0, 0.0, 0.0);
  162.     }
  163.     return 1;
  164. }
  165.  
  166. CMD:renunciar(playerid, params[])
  167. {
  168.     if(PlayerInfo[playerid][pCazador] == 1){}else return SendClientMessage(playerid,Rojo,"Error: No tienes este empleo");
  169.     PlayerInfo[playerid][pCazador] = 0;
  170.     SendClientMessage(playerid,Rojo,"[INFO]: {F6F8F5}Dejaste el empleo de cazador");
  171.     DestroyObject(Bambi[playerid]);
  172.     return 1;
  173. }
  174.  
  175. //comandos de test
  176. CMD:irx(playerid, params[])
  177. {
  178.     SetPlayerPos(playerid,-1687.25427, -2168.04907, 38.27590);
  179.     return 1;
  180. }
  181.  
  182. CMD:irx2(playerid, params[])
  183. {
  184.     SetPlayerPos(playerid,-1639.22363, -2314.11646, 59.25200);
  185.     return 1;
  186. }
  187.  
  188. CMD:irx3(playerid, params[])
  189. {
  190.     SetPlayerPos(playerid,-1513.02942, -2167.67188, 0.51030);
  191.     return 1;
  192. }
  193. CMD:irx4(playerid, params[])
  194. {
  195.     SetPlayerPos(playerid,-1769.84949, -2338.39404, 44.43521);
  196.     return 1;
  197. }
  198. CMD:irx5(playerid, params[])
  199. {
  200.     SetPlayerPos(playerid,-1720.98523, -2021.65540, 71.04913);
  201.     return 1;
  202. }
  203. CMD:irx6(playerid, params[])
  204. {
  205.     SetPlayerPos(playerid,-1411.85046, -2038.05493, 0.60150);
  206.     return 1;
  207. }
  208. CMD:irx7(playerid, params[])
  209. {
  210.     SetPlayerPos(playerid,-1353.24121, -2418.34351, 31.89130);
  211.     return 1;
  212. }
  213. CMD:irx8(playerid, params[])
  214. {
  215.     SetPlayerPos(playerid,-1487.88245, -2570.38428, 71.90640);
  216.     return 1;
  217. }
  218. CMD:irx9(playerid, params[])
  219. {
  220.     SetPlayerPos(playerid,-1610.81677, -2694.43848, 48.01360);
  221.     return 1;
  222. }
  223. CMD:irx10(playerid, params[])
  224. {
  225.     SetPlayerPos(playerid,-1241.92603, -2334.24463, 18.44890);
  226.     return 1;
  227. }
  228.  
  229. stock pName(playerid)
  230. {
  231.     new name[MAX_PLAYER_NAME];
  232.     GetPlayerName(playerid,name,sizeof(name));
  233.     return name;
  234. }
  235. /* FS CREADO POR STRIKE
  236.  
  237. BRUNO DA SILVA SCRIPT DETECTAR DISPARO*/
  238.  
  239.  
  240.  
  241. // www.ips-team.blogspot.com
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement