Advertisement
Guest User

ADMIN ACTION

a guest
Sep 27th, 2015
667
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 3.11 KB | None | 0 0
  1. //////////////////////////////////////////////Admin Action par StreetRP//////////////////////////////////////////////
  2. #include <a_samp>
  3. #define DIALOG_MENU 1
  4. #define DIALOG_MSG 2
  5. #define DIALOG_MONEY_ADD 3
  6. #define DIALOG_MONEY_WITHDRAW 4
  7. #define DIALOG_SCORE 5
  8.  
  9. new jvise[MAX_PLAYERS];
  10. new msg[128],valeur;
  11. #if defined FILTERSCRIPT
  12.  
  13. public OnFilterScriptInit()
  14. {
  15.     print("\n--------------------------------------");
  16.     print(" Admin Action par StreetRP");
  17.     print("--------------------------------------\n");
  18.     return 1;
  19. }
  20.  
  21. public OnFilterScriptExit()
  22. {
  23.     return 1;
  24. }
  25.  
  26. #else
  27.  
  28.  
  29. #endif
  30.  
  31.  
  32. slap(playerid)
  33. {
  34.     static
  35.     Float:x,
  36.     Float:y,
  37.     Float:z;
  38.  
  39.     GetPlayerPos(playerid, x, y, z);
  40.     SetPlayerPos(playerid, x, y, z + 5);
  41.     SendClientMessage(jvise[playerid], -1,"{F51685}Admin has slap you");
  42. }
  43.  
  44. public OnPlayerClickPlayer(playerid, clickedplayerid, source)
  45. {
  46.     if(IsPlayerAdmin(playerid)) {
  47.     ShowPlayerDialog(playerid, DIALOG_MENU, DIALOG_STYLE_LIST, "Action", "Freeze\nUnFreeze\nSlap\nSend Msg\nAdd money\nWithdraw Money\nChange Score", "Ok", "Close");}
  48.     jvise[playerid] = clickedplayerid;
  49.     return 1;
  50. }
  51.  
  52. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  53. {
  54.     if(dialogid == DIALOG_MSG)
  55.     {
  56.         if(response)
  57.         {
  58.             format(msg, sizeof(msg), "{F51685}Admin say to you :{EBEBEB} %s",inputtext);
  59.             SendClientMessage(jvise[playerid], -1,msg);
  60.         }
  61.     }
  62.     if(dialogid == DIALOG_MONEY_ADD)
  63.     {
  64.         if(response)
  65.         {
  66.             valeur = strval(inputtext);
  67.             GivePlayerMoney(jvise[playerid], valeur);
  68.             format(msg, sizeof(msg), "{F51685}Admin add to you :{EBEBEB} %d$",valeur);
  69.             SendClientMessage(jvise[playerid], -1,msg);
  70.         }
  71.     }
  72.     if(dialogid == DIALOG_MONEY_WITHDRAW)
  73.     {
  74.         if(response)
  75.         {
  76.             valeur = strval(inputtext);
  77.             GivePlayerMoney(jvise[playerid], -valeur);
  78.             format(msg, sizeof(msg), "{F51685}Admin withdraw your money:{EBEBEB} %d$",valeur);
  79.             SendClientMessage(jvise[playerid], -1,msg);
  80.         }
  81.     }
  82.     if(dialogid == DIALOG_SCORE)
  83.     {
  84.         if(response)
  85.         {
  86.             valeur = strval(inputtext);
  87.             SetPlayerScore(jvise[playerid],valeur);
  88.             format(msg, sizeof(msg), "{F51685}Admin change your score :{EBEBEB} %d",valeur);
  89.             SendClientMessage(jvise[playerid], -1,msg);
  90.         }
  91.     }
  92.     if(dialogid == DIALOG_MENU)
  93.     {
  94.         if(response)
  95.         {
  96.  
  97.             switch(listitem)
  98.             {
  99.                 case 0: {TogglePlayerControllable(jvise[playerid],0);   SendClientMessage(jvise[playerid], -1,"{F51685} Admin has freeze you");}
  100.                 case 1: {TogglePlayerControllable(jvise[playerid],1);   SendClientMessage(jvise[playerid], -1,"{F51685}Admin has unfreeze you");}
  101.                 case 2: slap(jvise[playerid]);
  102.                 case 3: ShowPlayerDialog(playerid,DIALOG_MSG, DIALOG_STYLE_INPUT, "Send a msg", "Enter your text:", "Ok", "Close");
  103.                 case 4: ShowPlayerDialog(playerid,DIALOG_MONEY_ADD, DIALOG_STYLE_INPUT, "Add money", "Enter the value:", "Ok", "Close");
  104.                 case 5: ShowPlayerDialog(playerid,DIALOG_MONEY_WITHDRAW, DIALOG_STYLE_INPUT, "Withdraw money", "Enter the value:", "Ok", "Close");
  105.                 case 6: ShowPlayerDialog(playerid,DIALOG_SCORE, DIALOG_STYLE_INPUT, "Change Score", "Enter the new score:", "Ok", "Close");
  106.             }
  107.         }
  108.     }
  109.     return 0;
  110. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement