Advertisement
Guest User

Untitled

a guest
Jul 6th, 2011
642
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 12.83 KB | None | 0 0
  1. /* Felhasznált include: seif_walk.inc
  2.    Készítette: Dario_Juarez
  3. */
  4.  
  5. #include <a_samp>
  6.  
  7. #define FILTERSCRIPT
  8. //dialog
  9. #define HARCSTILUS 1111
  10. #define SÉTASTILUS 1112
  11. //séta stílusok
  12. #define WALK_DEFAULT    0
  13. #define WALK_NORMAL     1
  14. #define WALK_PED        2
  15. #define WALK_GANGSTA    3
  16. #define WALK_GANGSTA2   4
  17. #define WALK_OLD        5
  18. #define WALK_FAT_OLD    6
  19. #define WALK_FAT        7
  20. #define WALK_LADY       8
  21. #define WALK_LADY2      9
  22. #define WALK_WHORE      10
  23. #define WALK_WHORE2     11
  24. #define WALK_DRUNK      12
  25. #define WALK_BLIND      13
  26. //színek
  27. #define ZOLD 0x33AA33AA
  28.  
  29. #if defined FILTERSCRIPT
  30.  
  31. new walktime[MAX_PLAYERS];
  32. new WalkStyle[MAX_PLAYERS];
  33.  
  34. public OnFilterScriptInit()
  35. {
  36.     print("\nF&W Styles By: Dario_Juarez loaded.\n");
  37.     return 1;
  38. }
  39.  
  40. public OnFilterScriptExit()
  41. {
  42.     print("\nF&W Styles By: Dario_Juarez unloaded.\n");
  43.     return 1;
  44. }
  45.  
  46. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  47. {
  48.     if (((newkeys & KEY_WALK && newkeys & KEY_UP) || (newkeys & KEY_WALK && newkeys & KEY_DOWN) || (newkeys & KEY_WALK && newkeys & KEY_LEFT) || (newkeys & KEY_WALK && newkeys & KEY_RIGHT))
  49.         || ((oldkeys & KEY_WALK && newkeys & KEY_UP) || (oldkeys & KEY_WALK && newkeys & KEY_DOWN) || (oldkeys & KEY_WALK && newkeys & KEY_LEFT) || (oldkeys & KEY_WALK && newkeys & KEY_RIGHT))
  50.         || ((newkeys & KEY_WALK && oldkeys & KEY_UP) || (newkeys & KEY_WALK && oldkeys & KEY_DOWN) || (newkeys & KEY_WALK && oldkeys & KEY_LEFT) || (newkeys & KEY_WALK && oldkeys & KEY_RIGHT))
  51.         && GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
  52.             walktime[playerid] = SetTimerEx("WalkAnim",200,0,"d",playerid);
  53.     return 1;
  54. }
  55.  
  56. forward Walk_OnPlayerKeyStateChange(playerid, newkeys, oldkeys);
  57.  
  58. #define OnPlayerKeyStateChange Walk_OnPlayerKeyStateChange
  59.  
  60. forward WalkAnim(playerid);
  61. public  WalkAnim(playerid)
  62. {
  63.     new keys, updown, leftright;
  64.     GetPlayerKeys(playerid,keys,updown,leftright);
  65.     if (GetPlayerWalkingStyle(playerid) == WALK_NORMAL)
  66.     {
  67.         if ((keys & KEY_WALK && updown & KEY_UP) || (keys & KEY_WALK && updown & KEY_DOWN) || (keys & KEY_WALK && leftright & KEY_LEFT) || (keys & KEY_WALK && leftright & KEY_RIGHT))
  68.         {
  69.             KillTimer(walktime[playerid]);
  70.             ApplyAnimation(playerid,"PED","WALK_player",4.1,1,1,1,1,1);
  71.             walktime[playerid] = SetTimerEx("WalkAnim",200,0,"d",playerid);
  72.         }
  73.         else ApplyAnimation(playerid,"PED","WALK_player",4.0,0,0,0,0,1), KillTimer(walktime[playerid]);
  74.     }
  75.     else if (GetPlayerWalkingStyle(playerid) == WALK_PED)
  76.     {
  77.         if ((keys & KEY_WALK && updown & KEY_UP) || (keys & KEY_WALK && updown & KEY_DOWN) || (keys & KEY_WALK && leftright & KEY_LEFT) || (keys & KEY_WALK && leftright & KEY_RIGHT))
  78.         {
  79.             KillTimer(walktime[playerid]);
  80.             ApplyAnimation(playerid,"PED","WALK_civi",4.1,1,1,1,1,1);
  81.             walktime[playerid] = SetTimerEx("WalkAnim",200,0,"d",playerid);
  82.         }
  83.         else ApplyAnimation(playerid,"PED","WALK_civi",4.0,0,0,0,0,1), KillTimer(walktime[playerid]);
  84.     }
  85.     else if (GetPlayerWalkingStyle(playerid) == WALK_GANGSTA)
  86.     {
  87.         if ((keys & KEY_WALK && updown & KEY_UP) || (keys & KEY_WALK && updown & KEY_DOWN) || (keys & KEY_WALK && leftright & KEY_LEFT) || (keys & KEY_WALK && leftright & KEY_RIGHT))
  88.         {
  89.             KillTimer(walktime[playerid]);
  90.             ApplyAnimation(playerid,"PED","WALK_gang1",4.1,1,1,1,1,1);
  91.             walktime[playerid] = SetTimerEx("WalkAnim",200,0,"d",playerid);
  92.         }
  93.         else ApplyAnimation(playerid,"PED","WALK_gang1",4.0,0,0,0,0,1), KillTimer(walktime[playerid]);
  94.     }
  95.     else if (GetPlayerWalkingStyle(playerid) == WALK_GANGSTA2)
  96.     {
  97.         if ((keys & KEY_WALK && updown & KEY_UP) || (keys & KEY_WALK && updown & KEY_DOWN) || (keys & KEY_WALK && leftright & KEY_LEFT) || (keys & KEY_WALK && leftright & KEY_RIGHT))
  98.         {
  99.             KillTimer(walktime[playerid]);
  100.             ApplyAnimation(playerid,"PED","WALK_gang2",4.1,1,1,1,1,1);
  101.             walktime[playerid] = SetTimerEx("WalkAnim",200,0,"d",playerid);
  102.         }
  103.         else ApplyAnimation(playerid,"PED","WALK_gang2",4.0,0,0,0,0,1), KillTimer(walktime[playerid]);
  104.     }
  105.     else if (GetPlayerWalkingStyle(playerid) == WALK_OLD)
  106.     {
  107.         if ((keys & KEY_WALK && updown & KEY_UP) || (keys & KEY_WALK && updown & KEY_DOWN) || (keys & KEY_WALK && leftright & KEY_LEFT) || (keys & KEY_WALK && leftright & KEY_RIGHT))
  108.         {
  109.             KillTimer(walktime[playerid]);
  110.             ApplyAnimation(playerid,"PED","WALK_old",4.1,1,1,1,1,1);
  111.             walktime[playerid] = SetTimerEx("WalkAnim",200,0,"d",playerid);
  112.         }
  113.         else ApplyAnimation(playerid,"PED","WALK_old",4.0,0,0,0,0,1), KillTimer(walktime[playerid]);
  114.     }
  115.     else if (GetPlayerWalkingStyle(playerid) == WALK_FAT_OLD)
  116.     {
  117.         if ((keys & KEY_WALK && updown & KEY_UP) || (keys & KEY_WALK && updown & KEY_DOWN) || (keys & KEY_WALK && leftright & KEY_LEFT) || (keys & KEY_WALK && leftright & KEY_RIGHT))
  118.         {
  119.             KillTimer(walktime[playerid]);
  120.             ApplyAnimation(playerid,"PED","WALK_fatold",4.1,1,1,1,1,1);
  121.             walktime[playerid] = SetTimerEx("WalkAnim",200,0,"d",playerid);
  122.         }
  123.         else ApplyAnimation(playerid,"PED","WALK_fatold",4.0,0,0,0,0,1), KillTimer(walktime[playerid]);
  124.     }
  125.     else if (GetPlayerWalkingStyle(playerid) == WALK_FAT)
  126.     {
  127.         if ((keys & KEY_WALK && updown & KEY_UP) || (keys & KEY_WALK && updown & KEY_DOWN) || (keys & KEY_WALK && leftright & KEY_LEFT) || (keys & KEY_WALK && leftright & KEY_RIGHT))
  128.         {
  129.             KillTimer(walktime[playerid]);
  130.             ApplyAnimation(playerid,"PED","WALK_fat",4.1,1,1,1,1,1);
  131.             walktime[playerid] = SetTimerEx("WalkAnim",200,0,"d",playerid);
  132.         }
  133.         else ApplyAnimation(playerid,"PED","WALK_fat",4.0,0,0,0,0,1), KillTimer(walktime[playerid]);
  134.     }
  135.     else if (GetPlayerWalkingStyle(playerid) == WALK_LADY)
  136.     {
  137.         if ((keys & KEY_WALK && updown & KEY_UP) || (keys & KEY_WALK && updown & KEY_DOWN) || (keys & KEY_WALK && leftright & KEY_LEFT) || (keys & KEY_WALK && leftright & KEY_RIGHT))
  138.         {
  139.             KillTimer(walktime[playerid]);
  140.             ApplyAnimation(playerid,"PED","WOMAN_walknorm",4.1,1,1,1,1,1);
  141.             walktime[playerid] = SetTimerEx("WalkAnim",200,0,"d",playerid);
  142.         }
  143.         else ApplyAnimation(playerid,"PED","WOMAN_walknorm",4.0,0,0,0,0,1), KillTimer(walktime[playerid]);
  144.     }
  145.     else if (GetPlayerWalkingStyle(playerid) == WALK_LADY2)
  146.     {
  147.         if ((keys & KEY_WALK && updown & KEY_UP) || (keys & KEY_WALK && updown & KEY_DOWN) || (keys & KEY_WALK && leftright & KEY_LEFT) || (keys & KEY_WALK && leftright & KEY_RIGHT))
  148.         {
  149.             KillTimer(walktime[playerid]);
  150.             ApplyAnimation(playerid,"PED","WOMAN_walkbusy",4.1,1,1,1,1,1);
  151.             walktime[playerid] = SetTimerEx("WalkAnim",200,0,"d",playerid);
  152.         }
  153.         else ApplyAnimation(playerid,"PED","WOMAN_walkbusy",4.0,0,0,0,0,1), KillTimer(walktime[playerid]);
  154.     }
  155.     else if (GetPlayerWalkingStyle(playerid) == WALK_WHORE)
  156.     {
  157.         if ((keys & KEY_WALK && updown & KEY_UP) || (keys & KEY_WALK && updown & KEY_DOWN) || (keys & KEY_WALK && leftright & KEY_LEFT) || (keys & KEY_WALK && leftright & KEY_RIGHT))
  158.         {
  159.             KillTimer(walktime[playerid]);
  160.             ApplyAnimation(playerid,"PED","WOMAN_walkpro",4.1,1,1,1,1,1);
  161.             walktime[playerid] = SetTimerEx("WalkAnim",200,0,"d",playerid);
  162.         }
  163.         else ApplyAnimation(playerid,"PED","WOMAN_walkpro",4.0,0,0,0,0,1), KillTimer(walktime[playerid]);
  164.     }
  165.     else if (GetPlayerWalkingStyle(playerid) == WALK_WHORE2)
  166.     {
  167.         if ((keys & KEY_WALK && updown & KEY_UP) || (keys & KEY_WALK && updown & KEY_DOWN) || (keys & KEY_WALK && leftright & KEY_LEFT) || (keys & KEY_WALK && leftright & KEY_RIGHT))
  168.         {
  169.             KillTimer(walktime[playerid]);
  170.             ApplyAnimation(playerid,"PED","WOMAN_walksexy",4.1,1,1,1,1,1);
  171.             walktime[playerid] = SetTimerEx("WalkAnim",200,0,"d",playerid);
  172.         }
  173.         else ApplyAnimation(playerid,"PED","WOMAN_walksexy",4.0,0,0,0,0,1), KillTimer(walktime[playerid]);
  174.     }
  175.     else if (GetPlayerWalkingStyle(playerid) == WALK_DRUNK)
  176.     {
  177.         if ((keys & KEY_WALK && updown & KEY_UP) || (keys & KEY_WALK && updown & KEY_DOWN) || (keys & KEY_WALK && leftright & KEY_LEFT) || (keys & KEY_WALK && leftright & KEY_RIGHT))
  178.         {
  179.             KillTimer(walktime[playerid]);
  180.             ApplyAnimation(playerid,"PED","WALK_drunk",4.1,1,1,1,1,1);
  181.             walktime[playerid] = SetTimerEx("WalkAnim",200,0,"d",playerid);
  182.         }
  183.         else ApplyAnimation(playerid,"PED","WALK_drunk",4.0,0,0,0,0,1), KillTimer(walktime[playerid]);
  184.     }
  185.     else if (GetPlayerWalkingStyle(playerid) == WALK_BLIND)
  186.     {
  187.         if ((keys & KEY_WALK && updown & KEY_UP) || (keys & KEY_WALK && updown & KEY_DOWN) || (keys & KEY_WALK && leftright & KEY_LEFT) || (keys & KEY_WALK && leftright & KEY_RIGHT))
  188.         {
  189.             KillTimer(walktime[playerid]);
  190.             ApplyAnimation(playerid,"PED","Walk_Wuzi",4.1,1,1,1,1,1);
  191.             walktime[playerid] = SetTimerEx("WalkAnim",200,0,"d",playerid);
  192.         }
  193.         else ApplyAnimation(playerid,"PED","Walk_Wuzi",4.0,0,0,0,0,1), KillTimer(walktime[playerid]);
  194.     }
  195.     return 1;
  196. }
  197.  
  198. stock SetPlayerWalkingStyle(playerid, style)
  199. {
  200.     WalkStyle[playerid] = style;
  201. }
  202.  
  203. stock GetPlayerWalkingStyle(playerid)
  204. {
  205.     return WalkStyle[playerid];
  206. }
  207.  
  208. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  209. {
  210.     if(dialogid == HARCSTILUS)
  211.     {
  212.         if(response)
  213.         {
  214.             if(listitem == 0)
  215.             {
  216.                 SetPlayerFightingStyle (playerid, FIGHT_STYLE_BOXING);
  217.                 SendClientMessage(playerid, ZOLD, " Harcstílus megváltoztatva !");
  218.             }
  219.             if(listitem == 1)
  220.             {
  221.                 SetPlayerFightingStyle (playerid, FIGHT_STYLE_ELBOW);
  222.                 SendClientMessage(playerid, ZOLD, " Harcstílus megváltoztatva !");
  223.             }
  224.             if(listitem == 2)
  225.             {
  226.                 SetPlayerFightingStyle (playerid, FIGHT_STYLE_KNEEHEAD);
  227.                 SendClientMessage(playerid, ZOLD, " Harcstílus megváltoztatva !");
  228.             }
  229.             if(listitem == 3)
  230.             {
  231.                 SetPlayerFightingStyle (playerid, FIGHT_STYLE_KUNGFU);
  232.                 SendClientMessage(playerid, ZOLD, " Harcstílus megváltoztatva !");
  233.             }
  234.             if(listitem == 4)
  235.             {
  236.                 SetPlayerFightingStyle (playerid, FIGHT_STYLE_GRABKICK);
  237.                 SendClientMessage(playerid, ZOLD, " Harcstílus megváltoztatva !");
  238.             }
  239.             if(listitem == 5)
  240.             {
  241.                 SetPlayerFightingStyle (playerid, FIGHT_STYLE_NORMAL);
  242.             }
  243.         }
  244.     }
  245.     if(dialogid == SÉTASTILUS)
  246.     {
  247.         if(response)
  248.         {
  249.             if(listitem == 0)
  250.             {
  251.                 SetPlayerWalkingStyle (playerid, WALK_NORMAL);
  252.                 SendClientMessage(playerid, ZOLD, "style de marche changé!");
  253.             }
  254.             if(listitem == 1)
  255.             {
  256.                 SetPlayerWalkingStyle (playerid, WALK_PED);
  257.                 SendClientMessage(playerid, ZOLD, "style de marche changé!");
  258.             }
  259.             if(listitem == 2)
  260.             {
  261.                 SetPlayerWalkingStyle (playerid, WALK_GANGSTA);
  262.                 SendClientMessage(playerid, ZOLD, "style de marche changé!");
  263.             }
  264.             if(listitem == 3)
  265.             {
  266.                 SetPlayerWalkingStyle (playerid, WALK_GANGSTA2);
  267.                 SendClientMessage(playerid, ZOLD, "style de marche changé!");
  268.             }
  269.             if(listitem == 4)
  270.             {
  271.                 SetPlayerWalkingStyle (playerid, WALK_OLD);
  272.                 SendClientMessage(playerid, ZOLD, "style de marche changé!");
  273.             }
  274.             if(listitem == 5)
  275.             {
  276.                 SetPlayerWalkingStyle (playerid, WALK_FAT_OLD);
  277.                 SendClientMessage(playerid, ZOLD, "style de marche changé!");
  278.             }
  279.             if(listitem == 6)
  280.             {
  281.                 SetPlayerWalkingStyle (playerid, WALK_FAT);
  282.                 SendClientMessage(playerid, ZOLD, "style de marche changé!");
  283.             }
  284.             if(listitem == 7)
  285.             {
  286.                 SetPlayerWalkingStyle (playerid, WALK_LADY);
  287.                 SendClientMessage(playerid, ZOLD, "style de marche changé!");
  288.             }
  289.             if(listitem == 8)
  290.             {
  291.                 SetPlayerWalkingStyle (playerid, WALK_LADY2);
  292.                 SendClientMessage(playerid, ZOLD, "style de marche changé!");
  293.             }
  294.             if(listitem == 9)
  295.             {
  296.                 SetPlayerWalkingStyle (playerid, WALK_WHORE);
  297.                 SendClientMessage(playerid, ZOLD, "style de marche changé!");
  298.             }
  299.             if(listitem == 10)
  300.             {
  301.                 SetPlayerWalkingStyle (playerid, WALK_WHORE2);
  302.                 SendClientMessage(playerid, ZOLD, "style de marche changé!");
  303.             }
  304.             if(listitem == 11)
  305.             {
  306.                 SetPlayerWalkingStyle (playerid, WALK_DRUNK);
  307.                 SendClientMessage(playerid, ZOLD, "style de marche changé!");
  308.             }
  309.             if(listitem == 12)
  310.             {
  311.                 SetPlayerWalkingStyle (playerid, WALK_BLIND);
  312.                 SendClientMessage(playerid, ZOLD, "style de marche changé!");
  313.             }
  314.             if(listitem == 13)
  315.             {
  316.                 SetPlayerWalkingStyle (playerid, WALK_DEFAULT);
  317.                 SendClientMessage(playerid, ZOLD, "style de marche changé!");
  318.             }
  319.         }
  320.     }
  321.     return 1;
  322. }
  323.  
  324. public OnPlayerCommandText(playerid, cmdtext[])
  325. {
  326.     if (strcmp("/harcstílus", cmdtext, true, 10) == 0)
  327.     {
  328.         if(IsPlayerConnected(playerid))
  329.         {
  330.             {
  331.                 ShowPlayerDialog(playerid, HARCSTILUS, DIALOG_STYLE_LIST, "Harci Stílusok", "Box\nElbow\nKneehead\nKung-Fu\nGrabKick\nNormál", "Kiválaszt", "Mégse");
  332.             }
  333.         }
  334.         return 1;
  335.     }
  336.     if (strcmp("/style", cmdtext, true, 10) == 0)
  337.     {
  338.         if(IsPlayerConnected(playerid))
  339.         {
  340.             {
  341.                 ShowPlayerDialog(playerid, SÉTASTILUS, DIALOG_STYLE_LIST, "Differents style de marche", "Normál\nDécidé\nGangsta\nGangsta2\nAgée\nAgée2\nBoiteux\nFéminin1\nFéminin2\nPetasse\nPetasse2\nIvre\nHomme d'affaire\nNormal2", "Choisir", "Annuler");
  342.             }
  343.         }
  344.         return 1;
  345.     }
  346.     return 0;
  347. }
  348. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement