Advertisement
Guest User

Untitled

a guest
Sep 19th, 2015
299
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.34 KB | None | 0 0
  1. #include a_samp
  2. #include zcmd
  3.  
  4. #define blue 0x375FFFFF
  5. #define blue1 {00FFFF}
  6. #define yellow {FFFF00}
  7.  
  8. #define afkdialog 1165
  9. #define Gesher
  10.  
  11. new afk[MAX_PLAYERS];
  12.  
  13. new Text3D:label[MAX_PLAYERS];
  14.  
  15. CMD:afk(playerid,params[])
  16. {
  17. if(afk[playerid] == 1) return SendClientMessage(playerid,blue, "Tu ir taip AFK.");
  18. ShowPlayerDialog(playerid, afkdialog, DIALOG_STYLE_INPUT, "{00FFFF}Prieþastis", "{FFFF00}Paraðykite prieþastá kodël jûs AFK", "Gerai", "Iðeiti");
  19. return 1;
  20. }
  21. CMD:atgal(playerid,params[])
  22. {
  23. if(afk[playerid] == 0) return SendClientMessage(playerid,blue, "Gráþai ið AFK bûsenos");
  24. new string[128],pname[32];
  25. GetPlayerName(playerid,pname,sizeof(pname));
  26. format(string,sizeof(string),"%s {00FFFF}gráþo á þaidimà.",pname);
  27. SendClientMessageToAll(blue, string);
  28. Delete3DTextLabel(label[playerid]);
  29. TogglePlayerControllable(playerid,1);
  30. afk[playerid] = 0;
  31. return 1;
  32. }
  33. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  34. {
  35. if(dialogid == afkdialog) {
  36. if(response == 0) {
  37. new string[128],pname[32];
  38. GetPlayerName(playerid,pname,sizeof(pname));
  39. format(string,sizeof(string),"%s {00FFFF}yra AFK.",pname);
  40. SendClientMessageToAll(blue, string);
  41. label[playerid] = Create3DTextLabel(" ",0xFF0000FF,30.0,40.0,50.0,15.0,0);
  42. Update3DTextLabelText(label[playerid], 0xFF0000FF, "AFK");
  43. Attach3DTextLabelToPlayer(label[playerid], playerid, 0.0, 0.0, 0.4);
  44. SendClientMessage(playerid, blue, "Mes laukiame Jûsø. (/atgal)");
  45. TogglePlayerControllable(playerid,0);
  46. afk[playerid] = 1;
  47. return 1;
  48. }
  49. else if(response == 1) {
  50. if(!strlen(inputtext)) {
  51. new string[128],pname[32];
  52. GetPlayerName(playerid,pname,sizeof(pname));
  53. format(string,sizeof(string),"%s {00FFFF}yra AFK.",pname);
  54. SendClientMessageToAll(blue, string);
  55. label[playerid] = Create3DTextLabel(" ",0xFF0000FF,30.0,40.0,50.0,15.0,0);
  56. Update3DTextLabelText(label[playerid], 0xFF0000FF, "AFK");
  57. Attach3DTextLabelToPlayer(label[playerid], playerid, 0.0, 0.0, 0.4);
  58. SendClientMessage(playerid, blue, "Mes laukiame Jûsø. (/atgal)");
  59. TogglePlayerControllable(playerid,0);
  60. afk[playerid] = 1;
  61. } else if(strlen(inputtext))
  62. {
  63. new string[128],pname[32];
  64. GetPlayerName(playerid,pname,sizeof(pname));
  65. format(string,sizeof(string),"%s {00FFFF}yra AFK. {FFFF00}— %s",pname,inputtext);
  66. SendClientMessageToAll(blue, string);
  67. label[playerid] = Create3DTextLabel(" ",0xFF0000FF,30.0,40.0,50.0,15.0,0);
  68. format(string,sizeof(string),"AFK — %s",inputtext);
  69. Update3DTextLabelText(label[playerid], 0xFF0000FF, string);
  70. Attach3DTextLabelToPlayer(label[playerid], playerid, 0.0, 0.0, 0.4);
  71. SendClientMessage(playerid, blue, "Mes laukiame Jûsø. (/atgal)");
  72. TogglePlayerControllable(playerid,0);
  73. afk[playerid] = 1;
  74. return 1;
  75. }
  76. }
  77. }
  78. return 1;
  79. }
  80. public OnPlayerConnect(playerid)
  81. {
  82. afk[playerid] = 0;
  83. return 1;
  84. }
  85. public OnPlayerDisconnect(playerid)
  86. {
  87. afk[playerid] = 0;
  88. return 1;
  89. }
  90. public OnPlayerText(playerid, text[])
  91. {
  92. if(afk[playerid] == 1) {
  93. SendClientMessage(playerid, blue, "Jûs negalite kalbëti kaip esat AFK bûsenoje.");
  94. return 0;
  95. }
  96. return 1;
  97. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement