Advertisement
Guest User

Untitled

a guest
Aug 7th, 2018
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.37 KB | None | 0 0
  1. CMD:agl(playerid,params[])
  2. {
  3. if(gPlayerLogged[playerid] == 0) return SCM(playerid, COLOR_LIGHTRED, "Nu esti logat.");
  4. if(IsPlayerConnected(playerid))
  5. {
  6. if (PlayerInfo[playerid][pAdmin] >= 2)
  7. {
  8. new id,x_nr[10],sendername[25],giveplayer[25],string[128];
  9. if(sscanf(params, "us[10]",id,x_nr))
  10. {
  11. SendClientMessage(playerid, COLOR_WHITE, "{25FDE9}Usage: {25FDE9}/agl <Name/Playerid> <License>");
  12. SendClientMessage(playerid, COLOR_WHITE, "Available names: Driving, Pilots, Sailing, Weapon, All.");
  13. return 1;
  14. }
  15. if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_WHITE, "{FFFFCC}Error: Player not connected.");
  16. GetPlayerName(playerid, sendername, sizeof(sendername));
  17. GetPlayerName(id, giveplayer, sizeof(giveplayer));
  18. if(strcmp(x_nr,"driving",true) == 0)
  19. {
  20. format(string, sizeof(string), "* You've given a Drivers License to %s.",giveplayer);
  21. SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
  22. format(string, sizeof(string), "* Admin %s has given you a Drivers License.",sendername);
  23. SendClientMessage(id, COLOR_LIGHTBLUE, string);
  24. PlayerInfo[id][pCarLic] = 1;
  25. PlayerInfo[id][pCarLicT] = 100;
  26. PlayerInfo[id][pCarLicSuspend] = 0;
  27. Update(id, pCarLicSuspendx);
  28. new str[128];
  29. mysql_format(SQL,str,128,"UPDATE users SET `CarLic`='1',`CarLicT`='100' WHERE `name`='%s'",PlayerInfo[id][pNormalName]);
  30. mysql_tquery(SQL,str,"","");
  31. return 1;
  32. }
  33. else if(strcmp(x_nr,"pilots",true) == 0)
  34. {
  35. format(string, sizeof(string), "* You've given a Pilots License to %s.",giveplayer);
  36. SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
  37. format(string, sizeof(string), "* Admin %s has given you a Pilots License.",sendername);
  38. SendClientMessage(id, COLOR_LIGHTBLUE, string);
  39. PlayerInfo[id][pFlyLic] = 1;
  40. PlayerInfo[id][pFlyLicT] = 100;
  41. new str[128];
  42. mysql_format(SQL,str,128,"UPDATE users SET `FlyLic`='1',`FlyLicT`='100' WHERE `name`='%s'",PlayerInfo[id][pNormalName]);
  43. mysql_tquery(SQL,str,"","");
  44. return 1;
  45. }
  46. else if(strcmp(x_nr,"sailing",true) == 0)
  47. {
  48. format(string, sizeof(string), "* You've given a Sailing License to %s.",giveplayer);
  49. SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
  50. format(string, sizeof(string), "* Admin %s has given you a Sailing License.",sendername);
  51. SendClientMessage(id, COLOR_LIGHTBLUE, string);
  52. PlayerInfo[id][pBoatLic] = 1;
  53. PlayerInfo[id][pBoatLicT] = 100;
  54. new str[128];
  55. mysql_format(SQL,str,128,"UPDATE users SET `BoatLic`='1',`BoatLicT`='100' WHERE `name`='%s'",PlayerInfo[id][pNormalName]);
  56. mysql_tquery(SQL,str,"","");
  57. return 1;
  58. }
  59. else if(strcmp(x_nr,"weapon",true) == 0)
  60. {
  61. format(string, sizeof(string), "* You've given a Weapon License to %s.",giveplayer);
  62. SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
  63. format(string, sizeof(string), "* Admin %s has given you a Weapon License.",sendername);
  64. SendClientMessage(id, COLOR_LIGHTBLUE, string);
  65. PlayerInfo[id][pGunLic] = 1;
  66. PlayerInfo[id][pGunLicT] = 100;
  67. PlayerInfo[id][pGunLicSuspend] = 0;
  68. Update(id, pGunLicSuspendx);
  69. new str[128];
  70. mysql_format(SQL,str,128,"UPDATE users SET `GunLic`='1',`GunLicT`='100' WHERE `name`='%s'",PlayerInfo[id][pNormalName]);
  71. mysql_tquery(SQL,str,"","");
  72. return 1;
  73. }
  74. else if(strcmp(x_nr,"all",true) == 0)
  75. {
  76. format(string, sizeof(string), "* You've given All Licenses to %s.",giveplayer);
  77. SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
  78. format(string, sizeof(string), "* Admin %s has given you All Licenses.",sendername);
  79. SendClientMessage(id, COLOR_LIGHTBLUE, string);
  80. //gun
  81. PlayerInfo[id][pGunLic] = 1;
  82. PlayerInfo[id][pGunLicT] = 100;
  83. PlayerInfo[id][pGunLicSuspend] = 0;
  84. Update(id, pGunLicSuspendx);
  85. new str[128];
  86. mysql_format(SQL,str,128,"UPDATE users SET `GunLic`='1',`GunLicT`='100' WHERE `name`='%s'",PlayerInfo[id][pNormalName]);
  87. mysql_tquery(SQL,str,"","");
  88. //boat
  89. PlayerInfo[id][pBoatLic] = 1;
  90. PlayerInfo[id][pBoatLicT] = 100;
  91. new str[128];
  92. mysql_format(SQL,str,128,"UPDATE users SET `BoatLic`='1',`BoatLicT`='100' WHERE `name`='%s'",PlayerInfo[id][pNormalName]);
  93. mysql_tquery(SQL,str,"","");
  94. //pilot
  95. PlayerInfo[id][pFlyLic] = 1;
  96. PlayerInfo[id][pFlyLicT] = 100;
  97. new str[128];
  98. mysql_format(SQL,str,128,"UPDATE users SET `FlyLic`='1',`FlyLicT`='100' WHERE `name`='%s'",PlayerInfo[id][pNormalName]);
  99. mysql_tquery(SQL,str,"","");
  100. //driving
  101. PlayerInfo[id][pCarLic] = 1;
  102. PlayerInfo[id][pCarLicT] = 100;
  103. PlayerInfo[id][pCarLicSuspend] = 0;
  104. Update(id, pCarLicSuspendx);
  105. mysql_format(SQL,str,128,"UPDATE users SET `CarLic`='1',`CarLicT`='100' WHERE `name`='%s'",PlayerInfo[id][pNormalName]);
  106. mysql_tquery(SQL,str,"","");
  107.  
  108. new str[128];
  109. mysql_format(SQL,str,128,"UPDATE users SET `GunLic`='1',`GunLicT`='100',`BoatLic`='1',`BoatLicT`='100',`FlyLic`='1',`FlyLicT`='100',`CarLic`='1',`CarLicT`='100' WHERE `name`='%s'",PlayerInfo[id][pNormalName]);
  110. mysql_tquery(SQL,str,"","");
  111. return 1;
  112. }
  113. }
  114. else return SendClientMessage(playerid, COLOR_ERROR, AdminOnly);
  115. }
  116. return 1;
  117. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement