Advertisement
Guest User

Untitled

a guest
Jan 9th, 2019
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.46 KB | None | 0 0
  1. CMD:spec(playerid, params[]) {
  2. if(playerVariables[playerid][pAdminLevel] >= 1 || playerVariables[playerid][pHelper] >= 1) {
  3. new
  4. userID;
  5.  
  6. if(sscanf(params, "u", userID)) {
  7. return SendUsage(playerid, "/spec [playerid]");
  8. }
  9. else if(!IsPlayerConnectedEx(userID)) {
  10. return SendClientMessage(playerid, COLOR_GREY, "The specified player is not connected, or has not authenticated.");
  11. }
  12. else if(playerVariables[playerid][pWarrants] >= 1) {
  13. return SendClientMessage(playerid, COLOR_GREY, "You are wanted, you can't spectante anyone.");
  14. }
  15. else if(AFK[playerid] >= 1) {
  16. return SendClientMessage(playerid, COLOR_GREY, "You can't spectate because you are sleeping.");
  17. }
  18. else if(playerVariables[playerid][pPrisonTime] >= 1) {
  19. return SendClientMessage(playerid, COLOR_GREY, "You can't spectate because you are in jail.");
  20. }
  21. else
  22. {
  23. if(groupVariables[playerVariables[playerid][pGroup]][gInWar] == 0)
  24. {
  25. GetPlayerPos(playerid, TeleportDest[playerid][0],TeleportDest[playerid][1],TeleportDest[playerid][2]);
  26. Interior[playerid] = GetPlayerInterior(playerid);
  27. VirWorld[playerid] = GetPlayerVirtualWorld(playerid);
  28. TogglePlayerSpectating(playerid, 1);
  29. playerVariables[playerid][pSpectating] = userID;
  30.  
  31. if(IsPlayerInAnyVehicle(userID))
  32. {
  33.  
  34. new string[500];
  35. new Float: health;
  36. GetPlayerHealth(userID, health);
  37.  
  38. new Float:health2;
  39. new veh = GetPlayerVehicleID(userID);
  40. GetVehicleHealth(veh, health2);
  41.  
  42. new Speed = GetSpeed(userID);
  43.  
  44. format(string, 500,"%s [%i] - L %i", playerVariables[userID][pNormalName], userID,playerVariables[userID][pLevel]);
  45. TextDrawSetString(info[playerid], string);
  46.  
  47. format(string, 500,"Health: %.0f", health);
  48. TextDrawSetString(viata[playerid], string);
  49.  
  50. format(string, 500,"W: %d - Jail: %d minutes", playerVariables[userID][pWarrants], playerVariables[userID][pPrisonTime] / 60);
  51. TextDrawSetString(wantedjail[playerid], string);
  52.  
  53. format(string, 500,"Car %d [%.0f HP]", GetPlayerVehicleID(userID), health2);
  54. TextDrawSetString(carinfo[playerid], string);
  55.  
  56. format(string, 500,"Speed: %d KM/H", Speed);
  57. TextDrawSetString(carspeed[playerid], string);
  58.  
  59.  
  60. TextDrawShowForPlayer(playerid, info[playerid]);
  61. TextDrawShowForPlayer(playerid, carspeed[playerid]);
  62. TextDrawShowForPlayer(playerid, carinfo[playerid]);
  63. TextDrawShowForPlayer(playerid, viata[playerid]);
  64. TextDrawShowForPlayer(playerid, wantedjail[playerid]);
  65.  
  66. PlayerSpectateVehicle(playerid, GetPlayerVehicleID(userID));
  67. }
  68. else
  69. {
  70. new Speed = GetSpeed(userID);
  71. new string[500];
  72. new Float: health;
  73. GetPlayerHealth(userID, health);
  74.  
  75. new Float:health2;
  76. new veh = GetPlayerVehicleID(userID);
  77. GetVehicleHealth(veh, health2);
  78.  
  79. format(string, 500,"%s [%i] - L %i", playerVariables[userID][pNormalName], userID,playerVariables[userID][pLevel]);
  80. TextDrawSetString(info[playerid], string);
  81.  
  82. format(string, 500,"Health: %.0f", health);
  83. TextDrawSetString(viata[playerid], string);
  84.  
  85. format(string, 500,"W: %d - Jail: %d minutes", playerVariables[userID][pWarrants], playerVariables[userID][pPrisonTime] / 60);
  86. TextDrawSetString(wantedjail[playerid], string);
  87.  
  88. format(string, 500,"Car %d [%.0f HP]", GetPlayerVehicleID(userID), health2);
  89. TextDrawSetString(carinfo[playerid], string);
  90.  
  91. format(string, 500,"Speed: %d KM/H", Speed);
  92. TextDrawSetString(carspeed[playerid], string);
  93.  
  94. TextDrawShowForPlayer(playerid, info[playerid]);
  95. TextDrawShowForPlayer(playerid, viata[playerid]);
  96. TextDrawShowForPlayer(playerid, wantedjail[playerid]);
  97.  
  98. PlayerSpectatePlayer(playerid, userID);
  99. }
  100. new Float:HAFloats, country[MAX_COUNTRY_NAME];
  101. GetPlayerHealth(userID,HAFloats);
  102. GetCountryName(playerVariables[userID][pConnectionIP], country, sizeof(country));
  103. format(szMessage, sizeof(szMessage), "(%i) %s | Level: %i | Health: %.1f | Status: %d | Country: %s | Ping: %i",userID, GetName(userID),playerVariables[userID][pLevel], HAFloats,playerVariables[userID][pStatus],country, GetPlayerPing(userID));
  104. SCM(playerid,COLOR_IN2, szMessage);
  105. }
  106. else SendClientMessage(playerid, COLOR_GREY, "You can't use this command in war time.");
  107. }
  108. }
  109. else return SendClientMessage(playerid, COLOR_WHITE, AdminOnly);
  110. return 1;
  111. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement