Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public OnClientPostAdminCheck(id){
- new String:sIp[99];
- GetClientIP(id, sIp, 14);
- if(!GeoipCountry(sIp, g_sCountry[id], sizeof(g_sCountry[]))){
- FormatEx(g_sCountry[id], sizeof g_sCountry[], "??");
- }
- }
- public onPlayerPreThink(id){
- if((GetGameTime() - g_fLastRefresh[id]) >= 0.5){
- formatSpecList(id);
- g_fLastRefresh[id] = GetGameTime();
- }
- }
- public OnClientDisconnect(id){
- SDKUnhook(id, SDKHook_PreThinkPost, onPlayerPreThink);
- g_bSpecDisabled[id]=false;
- g_fLastRefresh[id] = GetGameTime();
- }
- stock formatSpecList(id){
- if (g_bSpecDisabled[id] || IsPlayerAlive(id))
- return;
- new iSpecMode = GetEntProp(id, Prop_Send, "m_iObserverMode");
- if(iSpecMode == 4 || iSpecMode == 5){
- new iAliveTarget = GetEntPropEnt(id, Prop_Send, "m_hObserverTarget");
- if(!(1 <= iAliveTarget <= MaxClients) || !IsClientConnected(iAliveTarget) || IsFakeClient(iAliveTarget)) return;
- PrintHintText(id, "%t", "spectinfo", GetClientFrags(iAliveTarget), GetClientDeaths(iAliveTarget), Player[iAliveTarget][Distance], g_sCountry[iAliveTarget]);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement