Advertisement
Lordz

L-Bug Report System.

Sep 23rd, 2012
690
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 2.00 KB | None | 0 0
  1. /*L-Bug report v1.0
  2. By Lordz™.
  3. ********************Copyright (c) 2012 L-Bug report System.****************************/
  4.  
  5. #include <a_samp>
  6. #include <zcmd>
  7.  
  8. #define red 0xFF0000FF
  9. #define orange 0xFF9900AA
  10. #define green 0x33FF33AA
  11.  
  12. #define MESSAGE_PLAYERS
  13. //Comment this define to avoid messaging all players about the bug report.
  14.  
  15. new File:bugs;
  16. new SQ[MAX_PLAYERS];
  17.  
  18. public OnPlayerConnect(playerid)
  19. {
  20.     SQ[playerid] = 0;
  21.     return 1;
  22. }
  23.  
  24. CMD:rbug(playerid,params[])
  25. {
  26.     if(SQ[playerid] == 0)
  27.     {
  28.         SendClientMessage(playerid, red, "Secuirty Question:Please make sure that you're at the point where bug occurs and use the cmd again.");
  29.         SQ[playerid] = 1;
  30.         return 1;
  31.     }
  32.     if(SQ[playerid] >= 2)
  33.     {
  34.         SendClientMessage(playerid, red, "Please use /csq and then try.");
  35.         return 1;
  36.     }
  37.     new
  38.         string[192],
  39.         ip[16],
  40.         Lname[MAX_PLAYER_NAME],
  41.         Float:xpos,
  42.         Float:ypos,
  43.         Float:zpos,
  44.         interior = GetPlayerInterior(playerid),
  45.         skin = GetPlayerSkin(playerid),
  46.         ping = GetPlayerPing(playerid);
  47.  
  48.     if (isnull(params))
  49.     {
  50.         SendClientMessage(playerid, red, "Usage: /rbug [bug]");
  51.         SendClientMessage(playerid, orange, "Function: Will send the bug report to owners.");
  52.         return 1;
  53.     }
  54.     GetPlayerName(playerid, Lname, sizeof(Lname));
  55.     GetPlayerPos(playerid, xpos, ypos, zpos);
  56.     GetPlayerIp(playerid, ip, sizeof(ip));
  57.     bugs = fopen("Reported_Bugs.txt", io_append);
  58.     format(string,sizeof(string),"***Reporter:%s|IP:%s|Skin:%d|X:%f|Y:%f|Z:%f|Int:%i|Ping:%d|Bug:%s|Bug reported using L-Bug Report\r\n", Lname, ip, skin, xpos, ypos, zpos, interior, ping, params);
  59.     fwrite(bugs, string);
  60.     fclose(bugs);
  61.     #if defined MESSAGE_PLAYERS
  62.     format(string, sizeof(string), "[Bug Report] %s(ID:%d):%s", Lname, playerid, params);
  63.     SendClientMessageToAll(red, string);
  64.     #endif
  65.     SendClientMessage(playerid, green, "Your bug report has been sent. Thank you.");
  66.     return 1;
  67. }
  68.  
  69. CMD:csq(playerid,params[])
  70. {
  71.     SQ[playerid] = 0;
  72.     SendClientMessage(playerid, orange, "You are now safe to use /rbug.");
  73.     return 1;
  74. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement