Advertisement
Guest User

Untitled

a guest
May 12th, 2013
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.91 KB | None | 0 0
  1. /*-----------------------All Includes-----------------------*/
  2. #include <a_samp>
  3. #include <zcmd>
  4. #include <dini>
  5. #include <sscanf>
  6. #include <dutils>
  7. #include <Dudb>
  8. /*-----------------------All Includes-----------------------*/
  9.  
  10. /*-----------------------Save-----------------------*/
  11. #define savefolder "/Accounts/%s.ini"
  12. /*-----------------------Save-----------------------*/
  13.  
  14. /*-----------------------PM-----------------------*/
  15. new PMEnabled=1;
  16. forward PMLog(string[]);
  17. public PMLog(string[])
  18. {
  19. new pm[128];
  20. format(pm, sizeof(pm), "%s\n", string);
  21. new File:hFile;
  22. hFile = fopen("/LOGS/pm.log", io_append);
  23. fwrite(hFile, pm);
  24. fclose(hFile);
  25. }
  26. /*-----------------------PM-----------------------*/
  27.  
  28. /*-----------------------Short-----------------------*/
  29. #define SCM SendClientMessage
  30. #define SCMTA SendClientMessageToAll
  31. #define SPD ShowPlayerDialog
  32. /*-----------------------Short-----------------------*/
  33.  
  34. /*-----------------------Colours-----------------------*/
  35. #define C_YELLOW 0xFFFF00FF
  36. #define C_RED 0xFF0000C8
  37. #define C_BLUE 0x0080FFC8
  38. #define C_GREY 0xCECECEFF
  39. #define C_WHITE "{FFFFFF}"
  40. #define C_GREEN "{00FF22}"
  41. #define C_LIGHTBLUE "{00CED1}"
  42. /*-----------------------Colours-----------------------*/
  43.  
  44. /*-----------------------Configuration-----------------------*/
  45. #define joinsg (true)
  46. #define leavemsg (true)
  47. #define randmsg (true)
  48. #define randmsgtime (60)
  49. /*-----------------------Configuration-----------------------*/
  50.  
  51. /*-----------------------Prevent Warnings-----------------------*/
  52. #pragma unused strtok
  53. #pragma unused ret_memcpy
  54. /*-----------------------Prevent Warnings-----------------------*/
  55.  
  56. #if randmsg == true
  57. new RandMSGS;
  58. new RandomMessages[][] =
  59. {
  60. ">> This server using G_System [FS]! <<",
  61. ">> Use /rules to check server rules! <<",
  62. ">> Contact me at fb.com/mrzackysevenfold <<",
  63. ">> Visit our forum! www.forum.sa-mp.com <<"
  64. };
  65. #endif
  66.  
  67. #if randmsg == true
  68. forward RandomClientMessage();
  69. #endif
  70.  
  71. public OnFilterScriptInit()
  72. {
  73. #if randmsg == true
  74. RandMSGS = SetTimer("RandomClientMessage",randmsgtime*1000,true);
  75. #endif
  76. print("\n--------------------------------------");
  77. print("LOADING.......");
  78. print("G_System v1.0 Loaded!!!");
  79. print("--------------------------------------\n");
  80. return 1;
  81. }
  82.  
  83. public OnFilterScriptExit()
  84. {
  85. #if randmsg == true
  86. KillTimer(RandMSGS);
  87. #endif
  88. print("\n--------------------------------------");
  89. print("LOADING.......");
  90. print("G_System v1.0 Unloaded!!!");
  91. print("--------------------------------------\n");
  92. return 1;
  93. }
  94.  
  95. public OnGameModeExit()
  96. {
  97. return 1;
  98. }
  99.  
  100. public OnPlayerConnect(playerid)
  101. {
  102. if(IsPlayerAdmin(playerid))
  103. {
  104. new name[MAX_PLAYER_NAME];
  105. new string[218];
  106. GetPlayerName(playerid, name, sizeof(name));
  107. format(string, sizeof(string), "Rcon Admin %s has connected!", name);
  108. SCMTA(C_YELLOW, string);
  109. }
  110. #if defined joinmsg == true
  111. new string[180];
  112. GetPlayerName(playerid, pname, sizeof(pname));
  113. format(string, sizeof(string), "%s has connected to the server.",pname);
  114. SCMTA(C_GREY, string);
  115. #endif
  116. SendClientMessage(playerid, C_YELLOW, "This server using G_System [FS]");
  117. return 1;
  118. }
  119.  
  120. public OnPlayerDisconnect(playerid, reason)
  121. {
  122. #if defined leavemsg == true
  123. new string[180], pname[MAX_PLAYER_NAME];
  124. GetPlayerName(playerid, pname, sizeof(pname));
  125. format(string, sizeof(string), "%s has left the server.",pname);
  126. SCMTA(C_GREY, string);
  127. #endif
  128. return 1;
  129. }
  130.  
  131. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  132. {
  133. new string[128];
  134. format(string, sizeof(string), "You are entering %i.",vehicleid);
  135. SCM(playerid, C_RED, string);
  136. return 1;
  137. }
  138.  
  139. public OnPlayerExitVehicle(playerid, vehicleid)
  140. {
  141. new string[35];
  142. format(string, sizeof(string), "INFO: You are exiting vehicle %i", vehicleid);
  143. SCM(playerid, C_RED, string);
  144. new Float:health;
  145. health = GetVehicleHealth(vehicleid, health);
  146.  
  147. if(health >= 400 && health < 500)
  148. {
  149. GivePlayerMoney(playerid, -250);
  150. SCM(playerid, C_RED, "You've paid 250$ for the car damage you made.");
  151. }
  152. else if(health >= 500 && health < 650)
  153. {
  154. GivePlayerMoney(playerid, -750);
  155. SCM(playerid, C_RED, "You've paid 750$ for the car damage you made.");
  156. }
  157. else if(health >= 650 && health < 800)
  158. {
  159. GivePlayerMoney(playerid, -1250);
  160. SCM(playerid, C_RED, "You've paid 1250$ for the car damage you made.");
  161. }
  162. else if(health >= 800)
  163. {
  164. GivePlayerMoney(playerid, -1500);
  165. SCM(playerid, C_RED, "You've paid 1500$ for the car damage you made.");
  166. }
  167. return 1;
  168. }
  169.  
  170. public OnRconLoginAttempt(ip[], password[], success)
  171. {
  172. return 1;
  173. }
  174.  
  175. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  176. {
  177. return 1;
  178. }
  179.  
  180. CMD:pm(playerid, params [ ] )
  181. {
  182. if(IsPlayerConnected(playerid))
  183. {
  184. new pID, Message[60],playername[MAX_PLAYER_NAME],targetName[MAX_PLAYER_NAME],string[128],string2[128];
  185. if(sscanf(params, "us[60]", pID, Message)) return SCM(playerid, C_RED, "USAGE: /pm [ID] [Message]");
  186. if(pID == INVALID_PLAYER_ID) return SCM(playerid, C_RED, "Invalid Player");
  187. if(PMEnabled == 0) return SCM(playerid, C_RED, "PM Is Disabled");
  188. GetPlayerName(pID, targetName, sizeof(targetName));
  189. GetPlayerName(playerid, playername, sizeof(playername));
  190. format(string, sizeof(string), "Private Message from %s: %s", playername, Message);
  191. format(string2, sizeof(string2), "Private Message sent to %s: %s", targetName, Message);
  192. SCM(playerid, C_YELLOW, string2);
  193. SCM(pID, C_YELLOW, string);
  194. PMLog(string2);
  195. PMLog(string);
  196. }
  197. return 1;
  198. }
  199.  
  200. CMD:warn(playerid, params[])
  201. {
  202. if(IsPlayerAdmin(playerid))
  203. {
  204. new id; new reason; new string[64];
  205. if(!sscanf(params, "us", id, reason))
  206. {
  207. new Name[MAX_PLAYER_NAME]; new PlayerName[MAX_PLAYER_NAME];
  208. GetPlayerName(playerid, Name, sizeof(Name));
  209. GetPlayerName(id, PlayerName, sizeof(PlayerName));
  210. format(string, sizeof(string), "Administrator %s has warned %s for %s", Name, PlayerName, reason);
  211. SendClientMessageToAll(0xFFFFFFFF, string);
  212. return 1;
  213. }
  214. else return SendClientMessage(playerid, 0xFFFFFFFF, "Usage: /warn [ID][Reason]");
  215. }
  216. else return SendClientMessage(playerid, 0xFFFFFFFF, "You are not allowed to use this command.");
  217. }
  218.  
  219. #if randmsg == true
  220. public RandomClientMessage()
  221. {
  222. new randommsg = random(sizeof(RandomMessages));
  223. SendClientMessageToAll( C_BLUE, RandomMessages[randommsg]);
  224. return 1;
  225. }
  226. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement