Guest User

Untitled

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