Advertisement
Guest User

Untitled

a guest
Jan 18th, 2020
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.07 KB | None | 0 0
  1. public OnClientPostAdminCheck(id){
  2. new String:sIp[99];
  3. GetClientIP(id, sIp, 14);
  4.  
  5. if(!GeoipCountry(sIp, g_sCountry[id], sizeof(g_sCountry[]))){
  6. FormatEx(g_sCountry[id], sizeof g_sCountry[], "??");
  7. }
  8. }
  9.  
  10. public onPlayerPreThink(id){
  11. if((GetGameTime() - g_fLastRefresh[id]) >= 0.5){
  12. formatSpecList(id);
  13.  
  14. g_fLastRefresh[id] = GetGameTime();
  15. }
  16. }
  17.  
  18. public OnClientDisconnect(id){
  19. SDKUnhook(id, SDKHook_PreThinkPost, onPlayerPreThink);
  20. g_bSpecDisabled[id]=false;
  21. g_fLastRefresh[id] = GetGameTime();
  22. }
  23.  
  24.  
  25. stock formatSpecList(id){
  26. if (g_bSpecDisabled[id] || IsPlayerAlive(id))
  27. return;
  28.  
  29. new iSpecMode = GetEntProp(id, Prop_Send, "m_iObserverMode");
  30. if(iSpecMode == 4 || iSpecMode == 5){
  31. new iAliveTarget = GetEntPropEnt(id, Prop_Send, "m_hObserverTarget");
  32.  
  33. if(!(1 <= iAliveTarget <= MaxClients) || !IsClientConnected(iAliveTarget) || IsFakeClient(iAliveTarget)) return;
  34.  
  35. PrintHintText(id, "%t", "spectinfo", GetClientFrags(iAliveTarget), GetClientDeaths(iAliveTarget), Player[iAliveTarget][Distance], g_sCountry[iAliveTarget]);
  36. }
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement