Raised This Month: $ Target: $400
 0% 

Home voice only


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Asran
Member
Join Date: Aug 2007
Location: France
Old 01-04-2010 , 08:11   Home voice only
Reply With Quote #1

Hi there,

First, happy new year!

I was wondering if it was possible to write a plugin which can only allow users from the home country to use their microphone. A sort of ban voice of foreign countries...

Cheers!
__________________
Asran is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 01-04-2010 , 08:55   Re: Home voice only
Reply With Quote #2

Code:
#include < amxmodx > #include < geoip > #include < engine > new g_szServerCountry[ 46 ]; public plugin_init( ) {     register_plugin( "Country Voice", "0.0.1", "Exolent" );         copy( g_szServerCountry, 45, GetUserCountry( 0 ) ); } public client_putinserver( iPlayer ) {     if( equal( GetUserCountry( iPlayer ), g_szServerCountry ) ) {         set_speak( iPlayer, SPEAK_NORMAL );     } else {         set_speak( iPlayer, SPEAK_MUTED );     } } GetUserCountry( iPlayer ) {     static szIp[ 64 ];     get_user_ip( iPlayer, szIp, 63, 1 );         static szCountry[ 46 ];     geoip_country( szIp, szCountry, 45 );         return szCountry; }
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 19:40.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode