Raised This Month: $51 Target: $400
 12% 

Anti-change name too fast


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ditmesteam
Senior Member
Join Date: Oct 2009
Old 02-10-2010 , 08:21   Anti-change name too fast
Reply With Quote #1

May anyone make plugin anti-fast change name?
All players only can change their name interval 10 minute
For example they can change their name 3 times in 30 minutes of one map (10 minute for one change name)
Thank you in advanced.
ditmesteam is offline
Old 02-10-2010, 12:31
wrecked_
This message has been deleted by wrecked_. Reason: Exolent raped me.
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 02-10-2010 , 13:44   Re: Anti-change name too fast
Reply With Quote #2

Code:
#include < amxmodx > // interval between name changes in seconds #define NAME_CHANGE_WAIT 10 new Float:g_fLastNameChange[ 33 ]; public plugin_init( ) {     register_plugin( "Name Change Wait", "0.0.1", "Exolent" );         register_message( get_user_msgid( "SayText" ), "MessageSayText" ); } public client_disconnect( iPlayer ) {     g_fLastNameChange[ iPlayer ] = 0.0; } public client_infochanged( iPlayer ) {     new szNewName[ 32 ], szOldName[ 32 ];     get_user_info( iPlayer, "name", szNewName, 31 );     get_user_name( iPlayer, szOldName, 31 );         if( !equal( szNewName, szOldName ) )     {         new Float:fGametime = get_gametime( );         new Float:fDiff = g_fLastNameChange[ iPlayer ] + NAME_CHANGE_WAIT - fGametime;                 if( fDiff > 0.0 )         {             set_user_info( iPlayer, "name", szOldName );             client_print( iPlayer, print_center, "You must wait %.1f seconds before changing you name.", fDiff );         }         else         {             g_fLastNameChange[ iPlayer ] = fGametime;         }     } } public MessageSayText( iMsgID, iDest, iReceiver ) {     static const Cstrike_Name_Change[ ] = "#Cstrike_Name_Change";         new szMessage[ sizeof( Cstrike_Name_Change ) + 1 ];     get_msg_arg_string( 2, szMessage, sizeof( szMessage ) - 1 );         if( equal( szMessage, Cstrike_Name_Change ) )     {         new szName[ 32 ], iPlayer;         for( new i = 3; i <= 4; i++ )         {             get_msg_arg_string( i, szName, 31 );             iPlayer = get_user_index( szName );                         if( is_user_connected( iPlayer ) )             {                 if( ( g_fLastNameChange[ iPlayer ] + NAME_CHANGE_WAIT ) > get_gametime( ) )                 {                     return PLUGIN_HANDLED;                 }                                 break;             }         }     }         return PLUGIN_CONTINUE; }
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
wrecked_
Veteran Member
Join Date: Jan 2010
Location: New York (GMT-5)
Old 02-10-2010 , 13:57   Re: Anti-change name too fast
Reply With Quote #3

Quick question Exolent - what does the
PHP Code:
break; 
do? Does it act as some kind of return value?
__________________
[ Paid Requests ]
DO NOT PM ME ABOUT BLOCKMAKER
NO PRIVATE SUPPORT
wrecked_ is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 02-10-2010 , 13:59   Re: Anti-change name too fast
Reply With Quote #4

The break stops the loop.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
wrecked_
Veteran Member
Join Date: Jan 2010
Location: New York (GMT-5)
Old 02-10-2010 , 14:04   Re: Anti-change name too fast
Reply With Quote #5

Ah, thanks.
__________________
[ Paid Requests ]
DO NOT PM ME ABOUT BLOCKMAKER
NO PRIVATE SUPPORT
wrecked_ is offline
Seta00
The Seta00 user has crashed.
Join Date: Jan 2010
Location: Berlin
Old 02-10-2010 , 18:59   Re: Anti-change name too fast
Reply With Quote #6

Also, you can use
Code:
continue;
to go to the next iteration of the loop.
Seta00 is offline
wrecked_
Veteran Member
Join Date: Jan 2010
Location: New York (GMT-5)
Old 02-10-2010 , 19:04   Re: Anti-change name too fast
Reply With Quote #7

Quote:
Originally Posted by Seta00 View Post
Also, you can use
Code:
continue;
to go to the next iteration of the loop.
Yeah, I'd used that wrongly back when I first began scripting. I tried using that to replace
PHP Code:
return PLUGIN_CONTINUE
__________________
[ Paid Requests ]
DO NOT PM ME ABOUT BLOCKMAKER
NO PRIVATE SUPPORT
wrecked_ is offline
ditmesteam
Senior Member
Join Date: Oct 2009
Old 02-10-2010 , 20:18   Re: Anti-change name too fast
Reply With Quote #8

Thank Mr Exolent[jNr]
it work so fine, thank you so much!
ditmesteam is offline
ditmesteam
Senior Member
Join Date: Oct 2009
Old 02-11-2010 , 08:19   Re: Anti-change name too fast
Reply With Quote #9

Sorry, but players are auto change name into other of player name .... I must stop using plugin

Last edited by ditmesteam; 02-11-2010 at 08:36.
ditmesteam is offline
TigerMan
Junior Member
Join Date: Apr 2016
Old 05-20-2016 , 09:34   Re: Anti-change name too fast
Reply With Quote #10

this plugin perfect working but there is a problem with kill_asist plugin...
TigerMan 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 06:40.


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