Guest User

CØde dynamic animations

a guest
Oct 10th, 2010
748
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 17.44 KB | None | 0 0
  1. // CØde credits <Edit it use it in your gamemode you are free just keep the credits ^-^>
  2. // SA-MP
  3.  
  4. #define FILTERSCRIPT
  5. #include <a_samp>
  6. #include <a_angles>
  7.  
  8. #define GREY 0xAFAFAFAA
  9. #define BLUE2 0x92E4F4FF
  10.  
  11. #if defined FILTERSCRIPT
  12.  
  13. public OnFilterScriptInit()
  14. {
  15.     print("\n--------------------------------------");
  16.     print("CØde Dynamic animations");
  17.     print("--------------------------------------\n");
  18.     return 1;
  19. }
  20.  
  21. public OnFilterScriptExit()
  22. {
  23.     return 1;
  24. }
  25.  
  26. #else
  27.  
  28. main()
  29. {
  30.     print("\n----------------------------------");
  31.     print("CØde Dynamic animations");
  32.     print("----------------------------------\n");
  33. }
  34.  
  35. #endif
  36.  
  37. public OnGameModeInit()
  38. {
  39.     return 1;
  40. }
  41.  
  42. public OnGameModeExit()
  43. {
  44.     return 1;
  45. }
  46.  
  47. public OnPlayerRequestClass(playerid, classid)
  48. {
  49.     return 1;
  50. }
  51.  
  52. public OnPlayerConnect(playerid)
  53. {
  54.     SetPVarInt(playerid, "hug", 999);
  55.     SetPVarInt(playerid, "shake", 999);
  56.     SetPVarInt(playerid, "kiss", 999);
  57.     SetPVarInt(playerid, "hugtype", 0);
  58.     SetPVarInt(playerid, "useloopanim", 0);
  59.     PreloadAnimLib(playerid,"KISSING");
  60.     PreloadAnimLib(playerid,"PED");
  61.     PreloadAnimLib(playerid,"GANGS");
  62.     return 1;
  63. }
  64.  
  65. public OnPlayerDisconnect(playerid, reason)
  66. {
  67.     DeletePVar(playerid, "hug");
  68.     DeletePVar(playerid, "shake");
  69.     DeletePVar(playerid, "kiss");
  70.     DeletePVar(playerid, "hugtype");
  71.     DeletePVar(playerid, "useloopanim");
  72.     return 1;
  73. }
  74.  
  75. public OnPlayerSpawn(playerid)
  76. {
  77.     return 1;
  78. }
  79.  
  80. public OnPlayerDeath(playerid, killerid, reason)
  81. {
  82.     return 1;
  83. }
  84.  
  85. public OnVehicleSpawn(vehicleid)
  86. {
  87.     return 1;
  88. }
  89.  
  90. public OnVehicleDeath(vehicleid, killerid)
  91. {
  92.     return 1;
  93. }
  94.  
  95. public OnPlayerText(playerid, text[])
  96. {
  97.     return 1;
  98. }
  99.  
  100. public OnPlayerCommandText(playerid, cmdtext[])
  101. {
  102.     new string[180];
  103.     new sendername[MAX_PLAYER_NAME];
  104.     new giveplayer[MAX_PLAYER_NAME];
  105.     new cmd[128];
  106.     new tmp[128];
  107.     new idx;
  108.     cmd = strtok(cmdtext, idx);
  109.     if(strcmp(cmd,"/gangshake",true)==0)
  110.     {
  111.        if(IsPlayerConnected(playerid))
  112.        {
  113.           tmp = strtok(cmdtext, idx);
  114.           if(!strlen(tmp))
  115.           {
  116.               SendClientMessage(playerid, GREY, "/gangshake [playerid] [1 to 8]");
  117.               return 1;
  118.           }
  119.           new playa = ReturnUser(tmp);
  120.           tmp = strtok(cmdtext, idx);
  121.           if(!strlen(tmp))
  122.           {
  123.               SendClientMessage(playerid, GREY, "/gangshake [playerid] [1 to 8]");
  124.               return 1;
  125.           }
  126.           new kind = strval(tmp);
  127.           if(kind < 1 || kind > 8)
  128.           {
  129.               SendClientMessage(playerid, GREY, "availble numbers from 1 to 8");
  130.               return 1;
  131.           }
  132.           if(IsPlayerConnected(playa))
  133.           {
  134.              if(playa != INVALID_PLAYER_ID && playa != playerid)
  135.              {
  136.                 if(ProxDetectorS(1.0, playerid, playa))
  137.                 {
  138.                     GetPlayerName(playa, giveplayer, sizeof(giveplayer));
  139.                     GetPlayerName(playerid, sendername, sizeof(sendername));
  140.                     format(string, sizeof(string), "[INFO] You Have Offered %s A hug", giveplayer);
  141.                     SendClientMessage(playerid, BLUE2, string);
  142.                     format(string, sizeof(string), "[hug] %s is offering you a hug type /accept or /reject", sendername);
  143.                     SendClientMessage(playa, BLUE2, string);
  144.                     SetPVarInt(playa, "hug", playerid);
  145.                     SetPVarInt(playa,"hugtype",kind);
  146.                     return 1;
  147.                 }
  148.                 else { return SendClientMessage(playerid, GREY, "You are too far away"); }
  149.              }
  150.              else
  151.              {
  152.                 SendClientMessage(playerid, GREY, "That player is offline");
  153.              }
  154.           }
  155.        }
  156.        return 1;
  157.     }
  158.     if(strcmp(cmd,"/kiss",true)==0)
  159.     {
  160.        if(IsPlayerConnected(playerid))
  161.        {
  162.           tmp = strtok(cmdtext, idx);
  163.           if(!strlen(tmp))
  164.           {
  165.               SendClientMessage(playerid, GREY, "Correct: /kiss [PlayerID]");
  166.               return 1;
  167.           }
  168.           new playa;
  169.           playa = ReturnUser(tmp);
  170.           if(IsPlayerConnected(playa))
  171.           {
  172.              if(playa != INVALID_PLAYER_ID && playa != playerid)
  173.              {
  174.                 if(ProxDetectorS(1.0, playerid, playa))
  175.                 {
  176.                     GetPlayerName(playa, giveplayer, sizeof(giveplayer));
  177.                     GetPlayerName(playerid, sendername, sizeof(sendername));
  178.                     format(string, sizeof(string), "[INFO] You Have Offered %s A kiss", giveplayer);
  179.                     SendClientMessage(playerid, BLUE2, string);
  180.                     format(string, sizeof(string), "[kiss] %s is offering you a kiss type /accept or /reject", sendername);
  181.                     SendClientMessage(playa, BLUE2, string);
  182.                     SetPVarInt(playa, "kiss", playerid);
  183.                     return 1;
  184.                 }
  185.                 else { return SendClientMessage(playerid, GREY, "You are too far away"); }
  186.              }
  187.              else
  188.              {
  189.                 SendClientMessage(playerid, GREY, "That player is offline");
  190.              }
  191.           }
  192.        }
  193.        return 1;
  194.     }
  195.     if(strcmp(cmd,"/shake",true)==0)
  196.     {
  197.        if(IsPlayerConnected(playerid))
  198.        {
  199.           tmp = strtok(cmdtext, idx);
  200.           if(!strlen(tmp))
  201.           {
  202.               SendClientMessage(playerid, GREY, "Correct: /shake [PlayerID]");
  203.               return 1;
  204.           }
  205.           new playa;
  206.           playa = ReturnUser(tmp);
  207.           if(IsPlayerConnected(playa))
  208.           {
  209.              if(playa != INVALID_PLAYER_ID && playa != playerid)
  210.              {
  211.                 if(ProxDetectorS(1.0, playerid, playa))
  212.                 {
  213.                     GetPlayerName(playa, giveplayer, sizeof(giveplayer));
  214.                     GetPlayerName(playerid, sendername, sizeof(sendername));
  215.                     format(string, sizeof(string), "[INFO] You Have Offered %s A Hands shake", giveplayer);
  216.                     SendClientMessage(playerid, BLUE2, string);
  217.                     format(string, sizeof(string), "[HANDSshake] %s is offering you a hands shake type /accept or /reject", sendername);
  218.                     SendClientMessage(playa, BLUE2, string);
  219.                     SetPVarInt(playa, "shake", playerid);
  220.                     return 1;
  221.                 }
  222.                 else { return SendClientMessage(playerid, GREY, "You are too far away"); }
  223.              }
  224.              else
  225.              {
  226.                 SendClientMessage(playerid, GREY, "That player is offline");
  227.              }
  228.           }
  229.        }
  230.        return 1;
  231.     }
  232.     if(strcmp(cmd,"/accept",true)==0)
  233.     {
  234.         if(IsPlayerConnected(playerid))
  235.         {
  236.             if(GetPVarInt(playerid, "hug") < 999)
  237.             {
  238.                 if(IsPlayerConnected(GetPVarInt(playerid, "hug")))
  239.                 {
  240.                     if (ProxDetectorS(1.0, playerid, GetPVarInt(playerid, "hug")))
  241.                     {
  242.                         SetPlayerToFacePlayer(GetPVarInt(playerid, "hug"), playerid);
  243.                         SetPlayerToFacePlayer(playerid,GetPVarInt(playerid, "hug"));
  244.                         if(GetPVarInt(playerid,"hugtype") == 1)
  245.                         {
  246.                             ApplyAnimation(GetPVarInt(playerid, "hug"),"GANGS","hndshkfa_swt",4.0,0,0,0,0,0);
  247.                             ApplyAnimation(playerid,"GANGS","hndshkfa_swt",4.0,0,0,0,0,0);
  248.                         }
  249.                         if(GetPVarInt(playerid,"hugtype") == 2)
  250.                         {
  251.                             ApplyAnimation(playerid,"GANGS","hndshkaa",4.0,0,0,0,0,0);
  252.                             ApplyAnimation(GetPVarInt(playerid, "hug"),"GANGS","hndshkaa",4.0,0,0,0,0,0);
  253.                         }
  254.                         if(GetPVarInt(playerid,"hugtype") == 3)
  255.                         {
  256.                             ApplyAnimation(playerid,"GANGS","hndshkba",4.0,0,0,0,0,0);
  257.                             ApplyAnimation(GetPVarInt(playerid, "hug"),"GANGS","hndshkba",4.0,0,0,0,0,0);
  258.                         }
  259.                         if(GetPVarInt(playerid,"hugtype") == 4)
  260.                         {
  261.                             ApplyAnimation(playerid,"GANGS","hndshkca",4.0,0,0,0,0,0);
  262.                             ApplyAnimation(GetPVarInt(playerid, "hug"),"GANGS","hndshkca",4.0,0,0,0,0,0);
  263.                         }
  264.                         if(GetPVarInt(playerid,"hugtype") == 5)
  265.                         {
  266.                             ApplyAnimation(playerid,"GANGS","hndshkcb",4.0,0,0,0,0,0);
  267.                             ApplyAnimation(GetPVarInt(playerid, "hug"),"GANGS","hndshkcb",4.0,0,0,0,0,0);
  268.                         }
  269.                         if(GetPVarInt(playerid,"hugtype") == 6)
  270.                         {
  271.                             ApplyAnimation(playerid,"GANGS","hndshkda",4.0,0,0,0,0,0);
  272.                             ApplyAnimation(GetPVarInt(playerid, "hug"),"GANGS","hndshkda",4.0,0,0,0,0,0);
  273.                         }
  274.                         if(GetPVarInt(playerid,"hugtype") == 7)
  275.                         {
  276.                             ApplyAnimation(playerid,"GANGS","hndshkea",4.0,0,0,0,0,0);
  277.                             ApplyAnimation(GetPVarInt(playerid, "hug"),"GANGS","hndshkea",4.0,0,0,0,0,0);
  278.                         }
  279.                         if(GetPVarInt(playerid,"hugtype") == 8)
  280.                         {
  281.                             ApplyAnimation(playerid,"GANGS","hndshkfa",4.0,0,0,0,0,0);
  282.                             ApplyAnimation(GetPVarInt(playerid, "hug"),"GANGS","hndshkfa",4.0,0,0,0,0,0);
  283.                         }
  284.                         SetPVarInt(playerid, "hug", 999);
  285.                         SetPVarInt(playerid, "hugtype", 0);
  286.                         return 1;
  287.                     }
  288.                     else { return SendClientMessage(playerid, GREY, "You are too far away"); }
  289.                 }
  290.             }
  291.             else if(GetPVarInt(playerid, "kiss") < 999)
  292.             {
  293.                 if(IsPlayerConnected(GetPVarInt(playerid, "kiss")))
  294.                 {
  295.                     if(ProxDetectorS(1.0,playerid, GetPVarInt(playerid, "kiss")))
  296.                     {
  297.                         SetPlayerToFacePlayer(GetPVarInt(playerid, "kiss"), playerid);
  298.                         SetPlayerToFacePlayer(playerid,GetPVarInt(playerid, "kiss"));
  299.                         ApplyAnimation(GetPVarInt(playerid, "kiss"),"KISSING","Playa_kiss_03",4.0,0,0,0,0,0);
  300.                         ApplyAnimation(playerid,"KISSING","Playa_kiss_03",4.0,0,0,0,0,0);
  301.                         SetPVarInt(playerid, "kiss", 999);
  302.                     }
  303.                     else { return SendClientMessage(playerid, GREY, "You are too far away"); }
  304.                 }
  305.             }
  306.             else if(GetPVarInt(playerid, "shake") < 999)
  307.             {
  308.                 if(IsPlayerConnected(GetPVarInt(playerid, "shake")))
  309.                 {
  310.                     if(ProxDetectorS(1.0,playerid, GetPVarInt(playerid, "shake")))
  311.                     {
  312.                         SetPlayerToFacePlayer(GetPVarInt(playerid, "shake"), playerid);
  313.                         SetPlayerToFacePlayer(playerid,GetPVarInt(playerid, "shake"));
  314.                         ApplyAnimation(GetPVarInt(playerid, "shake"),"GANGS","prtial_hndshk_biz_01",3.0,0,0,0,0,0);
  315.                         ApplyAnimation(playerid,"GANGS","prtial_hndshk_biz_01",3.0,0,0,0,0,0);
  316.                         GetPlayerName(playerid, sendername, sizeof(sendername));
  317.                         SetPVarInt(playerid, "shake", 999);
  318.                     }
  319.                     else { return SendClientMessage(playerid, GREY, "You are too far away"); }
  320.                 }
  321.             }
  322.         }
  323.         return 1;
  324.     }
  325.     if(strcmp(cmd,"/reject",true)==0)
  326.     {
  327.         if(IsPlayerConnected(playerid))
  328.         {
  329.             if(GetPVarInt(playerid, "hug") < 999)
  330.             {
  331.                 if(IsPlayerConnected(GetPVarInt(playerid, "hug")))
  332.                 {
  333.                     if (ProxDetectorS(1.0, playerid, GetPVarInt(playerid, "hug")))
  334.                     {
  335.                         SetPlayerToFacePlayer(GetPVarInt(playerid, "hug"), playerid);
  336.                         SetPlayerToFacePlayer(playerid,GetPVarInt(playerid, "hug"));
  337.                         LoopingAnim(playerid,"ped", "endchat_01",4.0,1,0,0,1,1);
  338.                         SetTimerEx("removeanim",1500,0,"d",playerid);
  339.                         SetPVarInt(playerid, "hug", 999);
  340.                         SetPVarInt(playerid, "hugtype", 0);
  341.                         return 1;
  342.                     }
  343.                 }
  344.             }
  345.             else if(GetPVarInt(playerid, "kiss") < 999)
  346.             {
  347.                 if(IsPlayerConnected(GetPVarInt(playerid, "kiss")))
  348.                 {
  349.                     if(ProxDetectorS(1.0,playerid, GetPVarInt(playerid, "kiss")))
  350.                     {
  351.                         SetPlayerToFacePlayer(GetPVarInt(playerid, "kiss"), playerid);
  352.                         SetPlayerToFacePlayer(playerid,GetPVarInt(playerid, "kiss"));
  353.                         LoopingAnim(playerid,"ped", "endchat_01",4.0,1,0,0,1,1);
  354.                         SetTimerEx("removeanim",1500,0,"d",playerid);
  355.                         SetPVarInt(playerid, "kiss", 999);
  356.                         return 1;
  357.                     }
  358.                 }
  359.             }
  360.             else if(GetPVarInt(playerid, "shake") < 999)
  361.             {
  362.                 if(IsPlayerConnected(GetPVarInt(playerid, "shake")))
  363.                 {
  364.                     if(ProxDetectorS(1.0,playerid, GetPVarInt(playerid, "shake")))
  365.                     {
  366.                         SetPlayerToFacePlayer(GetPVarInt(playerid, "shake"), playerid);
  367.                         SetPlayerToFacePlayer(playerid,GetPVarInt(playerid, "shake"));
  368.                         LoopingAnim(playerid,"ped", "endchat_01",4.0,1,0,0,1,1);
  369.                         SetTimerEx("removeanim",1500,0,"d",playerid);
  370.                         SetPVarInt(playerid, "shake", 999);
  371.                         return 1;
  372.                     }
  373.                 }
  374.             }
  375.         }
  376.         return 1;
  377.     }
  378.     return 0;
  379. }
  380.  
  381. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  382. {
  383.     return 1;
  384. }
  385.  
  386. public OnPlayerExitVehicle(playerid, vehicleid)
  387. {
  388.     return 1;
  389. }
  390.  
  391. public OnPlayerStateChange(playerid, newstate, oldstate)
  392. {
  393.     return 1;
  394. }
  395.  
  396. public OnPlayerEnterCheckpoint(playerid)
  397. {
  398.     return 1;
  399. }
  400.  
  401. public OnPlayerLeaveCheckpoint(playerid)
  402. {
  403.     return 1;
  404. }
  405.  
  406. public OnPlayerEnterRaceCheckpoint(playerid)
  407. {
  408.     return 1;
  409. }
  410.  
  411. public OnPlayerLeaveRaceCheckpoint(playerid)
  412. {
  413.     return 1;
  414. }
  415.  
  416. public OnRconCommand(cmd[])
  417. {
  418.     return 1;
  419. }
  420.  
  421. public OnPlayerRequestSpawn(playerid)
  422. {
  423.     return 1;
  424. }
  425.  
  426. public OnObjectMoved(objectid)
  427. {
  428.     return 1;
  429. }
  430.  
  431. public OnPlayerObjectMoved(playerid, objectid)
  432. {
  433.     return 1;
  434. }
  435.  
  436. public OnPlayerPickUpPickup(playerid, pickupid)
  437. {
  438.     return 1;
  439. }
  440.  
  441. public OnVehicleMod(playerid, vehicleid, componentid)
  442. {
  443.     return 1;
  444. }
  445.  
  446. public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
  447. {
  448.     return 1;
  449. }
  450.  
  451. public OnVehicleRespray(playerid, vehicleid, color1, color2)
  452. {
  453.     return 1;
  454. }
  455.  
  456. public OnPlayerSelectedMenuRow(playerid, row)
  457. {
  458.     return 1;
  459. }
  460.  
  461. public OnPlayerExitedMenu(playerid)
  462. {
  463.     return 1;
  464. }
  465.  
  466. public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
  467. {
  468.     return 1;
  469. }
  470.  
  471. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  472. {
  473.     return 1;
  474. }
  475.  
  476. public OnRconLoginAttempt(ip[], password[], success)
  477. {
  478.     return 1;
  479. }
  480.  
  481. public OnPlayerUpdate(playerid)
  482. {
  483.     return 1;
  484. }
  485.  
  486. public OnPlayerStreamIn(playerid, forplayerid)
  487. {
  488.     return 1;
  489. }
  490.  
  491. public OnPlayerStreamOut(playerid, forplayerid)
  492. {
  493.     return 1;
  494. }
  495.  
  496. public OnVehicleStreamIn(vehicleid, forplayerid)
  497. {
  498.     return 1;
  499. }
  500.  
  501. public OnVehicleStreamOut(vehicleid, forplayerid)
  502. {
  503.     return 1;
  504. }
  505.  
  506. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  507. {
  508.     return 1;
  509. }
  510.  
  511. public OnPlayerClickPlayer(playerid, clickedplayerid, source)
  512. {
  513.     return 1;
  514. }
  515.  
  516. strtok(const string[], &index)
  517. {
  518.     new length = strlen(string);
  519.     while ((index < length) && (string[index] <= ' '))
  520.     {
  521.         index++;
  522.     }
  523.  
  524.     new offset = index;
  525.     new result[20];
  526.     while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
  527.     {
  528.         result[index - offset] = string[index];
  529.         index++;
  530.     }
  531.     result[index - offset] = EOS;
  532.     return result;
  533. }
  534.  
  535. ReturnUser(text[], playerid = INVALID_PLAYER_ID)
  536. {
  537.     new pos = 0;
  538.     while (text[pos] < 0x21) // Strip out leading spaces
  539.     {
  540.         if (text[pos] == 0) return INVALID_PLAYER_ID; // No passed text
  541.         pos++;
  542.     }
  543.     new userid = INVALID_PLAYER_ID;
  544.     if (IsNumeric(text[pos])) // Check whole passed string
  545.     {
  546.         // If they have a numeric name you have a problem (although names are checked on id failure)
  547.         userid = strval(text[pos]);
  548.         if (userid >=0 && userid < MAX_PLAYERS)
  549.         {
  550.             if(!IsPlayerConnected(userid))
  551.             {
  552.                 userid = INVALID_PLAYER_ID;
  553.             }
  554.             else
  555.             {
  556.                 return userid; // A player was found
  557.             }
  558.         }
  559.     }
  560.     new len = strlen(text[pos]);
  561.     new count = 0;
  562.     new name[MAX_PLAYER_NAME];
  563.     for (new i = 0; i < MAX_PLAYERS; i++)
  564.     {
  565.         if (IsPlayerConnected(i))
  566.         {
  567.             GetPlayerName(i, name, sizeof (name));
  568.             if (strcmp(name, text[pos], true, len) == 0) // Check segment of name
  569.             {
  570.                 if (len == strlen(name)) // Exact match
  571.                 {
  572.                     return i; // Return the exact player on an exact match
  573.                     // Otherwise if there are two players:
  574.                     // Me and MeYou any time you entered Me it would find both
  575.                     // And never be able to return just Me's id
  576.                 }
  577.                 else // Partial match
  578.                 {
  579.                     count++;
  580.                     userid = i;
  581.                 }
  582.             }
  583.         }
  584.     }
  585.     if (count != 1)
  586.     {
  587.         if (playerid != INVALID_PLAYER_ID)
  588.         {
  589.             if (count)
  590.             {
  591.                 SendClientMessage(playerid, 0xFF0000AA, "Multiple users found, please narrow earch");
  592.             }
  593.             else
  594.             {
  595.                 SendClientMessage(playerid, 0xFF0000AA, "No matching user found");
  596.             }
  597.         }
  598.         userid = INVALID_PLAYER_ID;
  599.     }
  600.     return userid; // INVALID_USER_ID for bad return
  601. }
  602.  
  603. IsNumeric(const string[])
  604. {
  605.     for (new i = 0, j = strlen(string); i < j; i++)
  606.     {
  607.         if (string[i] > '9' || string[i] < '0') return 0;
  608.     }
  609.     return 1;
  610. }
  611.  
  612. stock removeanim(playerid)
  613. {
  614.     StopLoopingAnim(playerid);
  615. }
  616.  
  617. LoopingAnim(playerid,animlib[],animname[], Float:Speed, looping, lockx, locky, lockz, lp)
  618. {
  619.     SetPVarInt(playerid, "useloopanim", 1);
  620.     ApplyAnimation(playerid, animlib, animname, Speed, looping, lockx, locky, lockz, lp);
  621. }
  622.  
  623. forward StopLoopingAnim(playerid);
  624. public StopLoopingAnim(playerid)
  625. {
  626.     SetPVarInt(playerid, "useloopanim", 0);
  627.     ApplyAnimation(playerid, "CARRY", "crry_prtial", 4.0, 0, 0, 0, 0, 0);
  628. }
  629.  
  630. forward ProxDetectorS(Float:radi, playerid, targetid);
  631. public ProxDetectorS(Float:radi, playerid, targetid) //Godfather credits
  632. {
  633.     //if (gdebug >= 3){//printf("DEBUG ProxDetectorS()");}
  634.     new Float:posx, Float:posy, Float:posz;
  635.     new Float:oldposx, Float:oldposy, Float:oldposz;
  636.     new Float:tempposx, Float:tempposy, Float:tempposz;
  637.     GetPlayerPos(playerid, oldposx, oldposy, oldposz);
  638.     //radi = 2.0; //Trigger Radius
  639.     GetPlayerPos(targetid, posx, posy, posz);
  640.     tempposx = (oldposx -posx);
  641.     tempposy = (oldposy -posy);
  642.     tempposz = (oldposz -posz);
  643.     ////printf("DEBUG: X:%f Y:%f Z:%f",posx,posy,posz);
  644.     if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
  645.     {
  646.         return 1;
  647.     }
  648.     return 0;
  649. }
  650.  
  651. PreloadAnimLib(playerid, animlib[])
  652. {
  653.     ApplyAnimation(playerid,animlib,"null",0.0,0,0,0,0,0);
  654. }
Advertisement
Add Comment
Please, Sign In to add comment