Raised This Month: $ Target: $400
 0% 

Need a Fix !! write_file()


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Spawner30
BANNED
Join Date: Dec 2013
Location: I Don't Know Yet
Old 05-11-2014 , 13:11   Need a Fix !! write_file()
Reply With Quote #1

! hello again !
i have a problem with my plugin .
so i want you to give me the better way to check frag player without ham_spawn and check it just for 1 time i mean the message + hud apear just for once [1] same thing with write in file !
hope u understand me !

Code:
#include < amxmodx > #include < hamsandwich > #define PLUGIN  "Admin-Check" #define AUTHOR  "Spawner" #define VERSION "1.0" new const NewFile[ 64 ] = "addons/amxmodx/configs/AdminRequest.ini"; new const WinnerMessage[] = ".y[.vWinner.y] .tHey Winner .y| .tYour Name Is Writed To Bee .v[Admin] .yWaiting For .v[Owner] .yTo Accept" new const PublicMessage[] = ".vThe Winner is: .t%s For Killing .v%i .yPlayers" new const HudMessage[]= "----------- The Winner For Request Admin Is %s ---------" new howmuch; public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)     RegisterHam( Ham_Spawn, "player", "SpawnCheck" );     howmuch = register_cvar("amx_request","10"); } public SpawnCheck( id ) {     if(get_user_frags(id) >= get_pcvar_num(howmuch))     {         static szName[ 32 ],szID[ 32 ],szIP[32];         get_user_name( id, szName, charsmax( szName )  );         get_user_authid( id, szID, charsmax( szID ) );         get_user_ip( id , szIP, charsmax( szID ) )                 new Format[ 128 ];         formatex( Format, 127, "[ Name : %s    | Steam id : %s | IP : %s | Killing : %i ]", szName , szID , szIP , get_pcvar_num(howmuch));                 write_file( NewFile, Format );                 Color_New(0, WinnerMessage);         Color_New(0, PublicMessage, szName,get_pcvar_num(howmuch));                 set_hudmessage(255, 0, 212, -1.0, 0.01, 2, 0.1, 40.0, 0.1, 0.1, -1)         show_hudmessage(0,HudMessage, szName)     } } stock Color_New( const id, const input[ ], any:... ) {     new count = 1, players[ 32 ]         static msg[ 191 ]     vformat( msg, 190, input, 3 )         replace_all( msg, 190, ".v", "^4" ) /* vert */     replace_all( msg, 190, ".y", "^1" ) /* yellow*/     replace_all( msg, 190, ".t", "^3" ) /* ct=Blue| t=red */     replace_all( msg, 190, ".x", "^0" ) /* normal*/         if( id ) players[ 0 ] = id; else get_players( players, count, "ch" )     {         for( new i = 0; i < count; i++ )     {         if( is_user_connected( players[ i ] ) )         {             message_begin( MSG_ONE_UNRELIABLE, get_user_msgid( "SayText" ), _, players[ i ] )             write_byte( players[ i ] );             write_string( msg );             message_end( );         }     } } }

Last edited by Spawner30; 05-11-2014 at 13:21.
Spawner30 is offline
Send a message via Skype™ to Spawner30
 



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 09:45.


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