Advertisement
Guest User

JoinLeave

a guest
Jul 31st, 2012
228
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.19 KB | None | 0 0
  1. #include <a_samp>
  2. #include <Colors>
  3. #include <zcmd>
  4. #include <dini>
  5.  
  6. #pragma tabsize 0
  7.  
  8. #define JoinFile "Join.ini"
  9. #define LeaveFile "Leave.ini"
  10.  
  11. /*
  12. me - for creating this script, and for color include
  13. Zeex for zcmd
  14. Dracoblue for dini
  15. sa-mpteam - for all sa-mp functions and callback
  16. */
  17.  
  18. /*
  19. This is a simple FIlterscript, JoinLeaveCreater with this you can create your own JoinLeave message
  20. Why to create this? : to be honest that was a ideea , but now i don't think so this will be soo usefull,
  21. Script created by XSTORMIEST
  22. */
  23.  
  24. public OnFilterScriptInit()
  25. {
  26. print("\n--------------------------------------");
  27. print("Free In-Game Converter Online");
  28. print("--------------------------------------\n");
  29. return 1;
  30. }
  31.  
  32. public OnFilterScriptExit()
  33. {
  34. return 1;
  35. }
  36.  
  37. public OnPlayerCommandText(playerid,cmdtext[])
  38. {
  39. return 1;
  40. }
  41.  
  42. CMD:jlmsg(playerid,params[])
  43. {
  44. if(!IsPlayerAdmin(playerid) ) return SendClientMessage(playerid,COLOR_RED,"This cmd is only for owner!!");
  45. else ShowPlayerDialog(playerid,47,DIALOG_STYLE_LIST,"Join Leave Creator", "Join Message\nLeave Message","Select","Cancel");
  46. return 1;
  47. }
  48.  
  49. public OnDialogResponse(playerid,dialogid,response,listitem,inputtext[])
  50. {
  51. if(dialogid == 47)
  52. {
  53. if(!response) return 1;
  54. if(response)
  55. {
  56. if(listitem == 0)
  57. {
  58. ShowPlayerDialog(playerid,56,DIALOG_STYLE_INPUT,"Join Message","Please write the text you want to writee.! please use format %s for your text:\nExample: Welcome , %s joined to the server","Create","Cancel");
  59. }
  60. if(listitem == 1)
  61. {
  62. ShowPlayerDialog(playerid,57,DIALOG_STYLE_INPUT,"Leave Message","Please write the text you want to writee.! please use format %s for your text:\nExample: %s had left the server","Next","Cancel");
  63. }
  64. }
  65. }
  66. if(dialogid == 56)
  67. {
  68. if(!response) return 1;
  69. if(response)
  70. {
  71. new name[MAX_PLAYER_NAME], string[256];
  72. format(string,sizeof(string), "Add this under OnPlayerConnect(playerid): =>>\r\nnew name[MAX_PLAYER_NAE], string[256];\r\nGetPlayerName(playerid,name,sizef(name));\r\nformat(string,sizeof(string),'%s',name);\r\nSendClientMessage(playerid,-1,string); ",inputtext[0],name[0]);
  73.  
  74. new File: file;
  75. file = fopen(JoinFile,io_append);
  76. if(file)
  77. {
  78. fwrite(file,string);
  79. fclose(file);
  80. }
  81. SendClientMessage(playerid,COLOR_YELLOW,"File created! check scriptfile at Join.ini");
  82. }
  83. }
  84. if(dialogid == 57)
  85. {
  86. new name[MAX_PLAYER_NAME], string[256];
  87. GetPlayerName(playerid,name,sizeof(name));
  88. format(string,sizeof(string),"Add this under OnPlayerDisconnect(playerid,reason)\r\nnew name[MAX_PLAYER_NAME],string[256]\r\nGetPlayerName(playerid,name,sizeof(name));\r\nformat(string,sizzeof(string),'%s',name);\r\nSendClientMessage(playerid,-1,string);",inputtext[0]);
  89.  
  90. new File: file;
  91. file = fopen(LeaveFile,io_append);
  92. if(file)
  93. {
  94. fwrite(file,string);
  95. fclose(file);
  96. }
  97. SendClientMessage(playerid,COLOR_YELLOW,"File created! check scriptfile at Leave.ini");
  98. }
  99. return 1;
  100. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement