Advertisement
Guest User

SAction by: Abagail(Testing Filter-Script)

a guest
Feb 1st, 2014
229
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 5.19 KB | None | 0 0
  1. /* Special Action Filter-Script by: Abagail */
  2. /* This allows you to set, and get a (giveplayerid) player's Special Action. */
  3. /* This was made mostly for testing purposes. */
  4.  
  5. #include <a_samp>
  6. #include zcmd
  7. #include sscanf2
  8.  
  9. CMD:getspecialaction(playerid, params[])
  10. {
  11. if(!IsPlayerAdmin(playerid)) return 0;
  12. new giveplayerid;
  13. if (sscanf(params, "u", giveplayerid))
  14. {
  15. new string[128];
  16. format(string, sizeof(string), "Your Special Action: %s(%s)", GetSpecialActionName(playerid), GetPlayerSpecialAction(playerid));
  17. SendClientMessage(playerid, -1, string);
  18. }
  19. if(IsPlayerConnected(giveplayerid))
  20. {
  21. new string[128];
  22. format(string, sizeof(string), "%s's(%d) Special Action: %s(%s)", GetName(giveplayerid), giveplayerid, GetSpecialActionName(playerid), GetPlayerSpecialAction(playerid));
  23. SendClientMessage(playerid, -1, string);
  24. // else } SendClientMessage(playerid, -1, "They aren't connected.");
  25. }
  26. return 1;
  27. }
  28.  
  29. CMD:setspecialaction(playerid, params[])
  30. {
  31. if(!IsPlayerAdmin(playerid)) return 0;
  32. new giveplayerid, action;
  33. if (sscanf(params, "u", giveplayerid, action)) return ActionMsg(playerid); // return SendClientMessage(playerid, -1, "CMD:setspecialaction [player] [action]");
  34. if(!IsPlayerConnected(giveplayerid)) return SendClientMessage(playerid, -1, "They aren't connected.");
  35. if(action = 0) SetPlayerSpecialAction(playerid, SPECIAL_ACTION_NONE);
  36. if(action = 1) SetPlayerSpecialAction(playerid, SPECIAL_ACTION_USEJETPACK);
  37. if(action = 2) SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DANCE1);
  38. if(action = 3) SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DANCE2);
  39. if(action = 4) SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DANCE3);
  40. if(action = 5) SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DANCE4);
  41. if(action = 6) SetPlayerSpecialAction(playerid, SPECIAL_ACTION_HANDSUP);
  42. if(action = 7) SetPlayerSpecialAction(playerid, SPECIAL_ACTION_USECELLPHONE);
  43. if(action = 8) SetPlayerSpecialAction(playerid, SPECIAL_ACTION_SITTING);
  44. if(action = 9) SetPlayerSpecialAction(playerid, SPECIAL_ACTION_STOPUSECELLPHONE);
  45. if(action = 10) SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_BEER);
  46. if(action = 11) SetPlayerSpecialAction(playerid, SPECIAL_ACTION_SMOKE_CIGGY);
  47. if(action = 12) SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_WINE);
  48. if(action = 13) SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_SPRUNK);
  49. if(action = 14) SetPlayerSpecialAction(playerid, SPECIAL_ACTION_CUFFED);
  50. if(action = 15) SetPlayerSpecialAction(playerid, SPECIAL_ACTION_CARRY);
  51. return ActionSet(playerid, giveplayerid);
  52. }
  53. stock GetName(playerid)
  54. {
  55.     new name[MAX_PLAYER_NAME];
  56.     GetPlayerName(playerid, name, sizeof(name));
  57.     return name;
  58. }
  59.  
  60. stock ActionSet(playerid, giveplayerid)
  61. {
  62. new string[128];
  63. format(string, sizeof(string), "You have set %s(%d)'s special action to %s(%s)", GetName(giveplayerid), giveplayerid, GetSpecialActionName(giveplayerid), GetPlayerSpecialAction(giveplayerid));
  64. SendClientMessage(playerid, -1, string);
  65. format(string, sizeof(string), "An Administrator has set your special action to %s(%s)", GetSpecialActionName(giveplayerid), GetPlayerSpecialAction(giveplayerid));
  66. SendClientMessage(playerid, -1, string);
  67. }
  68.  
  69.  
  70. stock ActionMsg(playerid)
  71. {
  72. SendClientMessage(playerid, -1, "USAGE: /setspecialaction [player] [action]");
  73. SendClientMessage(playerid, -1, "Actions: 0 - None | 1 - Use Jetpack, 2 - Dance1 | 3, Dance2, | 4 - Dance3, | 5, Dance4, | 6, Hands Up, ");
  74. SendClientMessage(playerid, -1, "Actions: 7 - UsePhone 8 - Sit(ting) 9 - PutAway Phone 10 - Drinking(Beer) 11 - Smoking Cigar(SmokeCiggy)");
  75. SendClientMessage(playerid, -1, "Actions: 12 - Drinking(Wine) 13 - Drinking(Sprunk), 14, - Cuffed(Hands Behind Back), 15 - Carry(ing)");
  76. }
  77. stock GetSpecialActionName(playerid)
  78. {
  79. new action = GetPlayerSpecialAction(playerid);
  80. new name[128];
  81. if(action == SPECIAL_ACTION_NONE) format(name, sizeof(name), "None");
  82. else if(action == SPECIAL_ACTION_USEJETPACK) format(name, sizeof(name), "Using Jetpack");
  83. else if(action == SPECIAL_ACTION_DANCE1) format(name, sizeof(name), "Dance 1");
  84. else if(action == SPECIAL_ACTION_DANCE2) format(name, sizeof(name), "Dance 2");
  85. else if(action == SPECIAL_ACTION_DANCE3) format(name, sizeof(name), "Dance 3");
  86. else if(action == SPECIAL_ACTION_DANCE4) format(name, sizeof(name), "Dance 4");
  87. else if(action == SPECIAL_ACTION_HANDSUP) format(name, sizeof(name), "Hands Up");
  88. else if(action == SPECIAL_ACTION_USECELLPHONE) format(name, sizeof(name), "Using Cell-Phone");
  89. else if(action == SPECIAL_ACTION_SITTING) format(name, sizeof(name), "Sitting");
  90. else if(action == SPECIAL_ACTION_STOPUSECELLPHONE) format(name, sizeof(name), "Putting Away Cell-Phone");
  91. else if(action == SPECIAL_ACTION_DRINK_BEER) format(name, sizeof(name), "Drinking Beer");
  92. else if(action == SPECIAL_ACTION_SMOKE_CIGGY) format(name, sizeof(name), "Smoking Cigar(Smoke Ciggy)");
  93. else if(action == SPECIAL_ACTION_DRINK_WINE) format(name, sizeof(name), "Drinking Wine");
  94. else if(action == SPECIAL_ACTION_DRINK_SPRUNK) format(name, sizeof(name), "Drinking Sprunk");
  95. else if(action == SPECIAL_ACTION_CUFFED) format(name, sizeof(name), "Cuffed(Handcuffed - hands behind (your)(their) back.");
  96. else if(action == SPECIAL_ACTION_CARRY) format(name, sizeof(name), "Carry(Carry(ing)");
  97. return name;
  98. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement