- #include <amxmodx>  
- #include <fakemeta>     
- #include <fvault>  
- #include <fun> 
- #include <cstrike> 
- ///Fordította DarkFly 
- new SZ_Password[ 192 ]  
- new SZ_Password_T[ 33 ][ 192 ]  
-   
- new Registrado[ 33 ]  
- new BadPassword[ 33 ]  
-   
- new const Vault[] = "GrenadeGame_Datos"  
-   
- new gCvarPluginToggle   
- new cvar_active  
-   
- new g_PlayerXP[33];  
- new g_PlayerLevel[33];  
-   
- new gBuyCommands[][] = { 
-     "usp", "glock", "deagle", "p228", "elites", "fn57", "m3", "xm1014", "mp5", "tmp", "p90", "mac10", "ump45", "ak47",    
-     "galil", "famas", "sg552", "m4a1", "aug", "scout", "awp", "g3sg1", "sg550", "m249", "vest", "vesthelm", "flash", "hegren",   
-     "sgren", "defuser", "nvgs", "shield", "primammo", "secammo", "km45", "9x19mm", "nighthawk", "228compact", "12gauge",   
-     "autoshotgun", "smg", "mp", "c90", "cv47", "defender", "clarion", "krieg552", "bullpup", "magnum", "d3au1", "krieg550",   
-     "buyammo1", "buyammo2"   
- }   
-   
- #define NUM_OF_LEVELS 10  
-   
- new const LEVELS[NUM_OF_LEVELS] = {  
-     100,   
-     200,   
-     400,   
-     800,  
-     1600,  
-     3200,  
-     6400,  
-     12800,  
-     25600,  
-     51200 
- } 
-   
- new const szHealth[] = { 
-     105, 110, 115, 120, 125, 130, 135, 140, 145, 150  
- } 
- new const szVelocity[] = { 
-     252, 254, 256, 260, 263, 267, 271, 275, 279, 284  
- } 
-   
- new gmsgStatusText;  
-   
- #define PLUGIN    "Grenade"   
- #define AUTHOR    "VodKa"   
- #define VERSION    "1.2"   
-   
- /* Register mod by Kiske */ 
-   
- public plugin_init()   
- {   
-     register_forward( FM_ClientUserInfoChanged, "FWClientUserInfoChanged" )  
-     register_event("CurWeapon" , "Event_CurWeapon" , "be" , "1=1" );   
-     gCvarPluginToggle = register_cvar("amx_block_buy", "1")   
-     cvar_active = register_cvar("amx_grenade",  "1")   
-     register_plugin(PLUGIN, VERSION, AUTHOR)    
-     register_logevent("Ham_PlayerSpawn", 2, "1=Round_Start");  
-     register_clcmd( "say /registrarse", "CMDRegistrarse" )  
-     register_clcmd( "IntroducirContrasenia", "CMDIntroducirContrasenia" )  
-     register_cvar("sv_grenadegame", "1")  
-     register_event("DeathMsg", "DeathMsg", "a")  
-     register_cvar("XP_per_kill", "20")  
-     register_event("ResetHUD", "ResetHud", "b")  
-     gmsgStatusText = get_user_msgid("StatusText")  
-     register_event("Niveles", "Event_Niveles", "be", "1=1");  
-   
-     for (new i = 0; i < sizeof (gBuyCommands); i++)   
-         register_clcmd(gBuyCommands[i], "BlockBuyCommands")   
- }   
-   
- public DeathMsg()  
- {      
-     if (!get_cvar_num("sv_grenadegame"))  
-         return;  
-   
-     new attacker = read_data(1)  
-     new victim = read_data(2) 
-   
-     if(g_PlayerLevel[attacker] == NUM_OF_LEVELS)  
-         return;  
-   
-     g_PlayerXP[attacker] += get_cvar_num("XP_per_kill")  
-   
-     if(g_PlayerXP[attacker] >= LEVELS[g_PlayerLevel[attacker]])  
-     {  
-         ++g_PlayerLevel[attacker];  
-   
-         client_print(attacker, _:print_chat, "[Grenade_Game] Gratulálunk szintet léptél %i!", g_PlayerLevel[attacker])  
-     }  
-     ShowHUD(attacker);  
-   
-     respawn_player(victim)  
-     give_item(victim, "weapon_hegrenade")   
-     give_item(victim, "weapon_flashbang")  
- }  
-   
- ShowHUD(id) { 
-     new HUD[51]  
-     format(HUD, 50, "[Grenade_Game] Szint: %i XP: %i", g_PlayerLevel[id], g_PlayerXP[id])  
-   
-     message_begin(MSG_ONE, gmsgStatusText, {0,0,0}, id)  
-     write_byte(0)  
-     write_string(HUD)  
-     message_end()  
- }  
-   
- public client_connect(id)  
- {  
-     g_PlayerXP[id] = 0;  
-     g_PlayerLevel[id] = 0;  
- }  
-   
- public Event_Niveles(id)  
- {  
-     set_pev(id, pev_health, szHealth[g_PlayerLevel[id]]); 
-     set_pev(id, pev_velocity, szVelocity[g_PlayerLevel[id]]); 
- }  
-   
- public client_disconnect(id)  
-     Save(id)   
-   
- public client_putinserver(id)  
- {  
-     Registrado[id] = 0  
-     BadPassword[id] = 0  
-     Load(id)  
- }  
-   
- public CMDRegistrarse(id)  
- {  
-     if( Registrado[id] || BadPassword[id] )  
-         return PLUGIN_HANDLED;  
-   
-     client_cmd( id, "messagemode IntroducirContrasenia" )  
-   
-     return PLUGIN_CONTINUE;  
- }  
-   
- public CMDIntroducirContrasenia(id)  
- {  
-     read_args( SZ_Password, 191 )   
-     remove_quotes( SZ_Password )   
-     trim( SZ_Password )   
-   
-     if( equal( SZ_Password, "" ) || contain( SZ_Password, " ") != -1)   
-         return PLUGIN_HANDLED;  
-     else   
-     {  
-         client_cmd(id, "setinfo _pass ^"%s^"", SZ_Password )   
-         Registrado[id] = 1         
-   
-         static SZ_Name[ 32 ], SZ_Data[ 512 ]  
-         get_user_name(id, SZ_Name, 31 )         
-   
-         formatex( SZ_Data, charsmax( SZ_Data ), "%s %d", SZ_Password, cs_get_user_money(id) )            
-   
-         fvault_set_data( Vault, SZ_Name, SZ_Data )  
-   
-         SZ_Password_T[id] = SZ_Password  
-   
-         return PLUGIN_HANDLED;  
-     }  
-   
-     return PLUGIN_CONTINUE;  
- }  
-   
- public Save(id)  
- {  
-     if( !Registrado[id] || BadPassword[id] )   
-         return PLUGIN_HANDLED;  
-   
-     static SZ_Data[ 512 ], SZ_Name[ 32 ]  
-   
-     formatex( SZ_Data, charsmax( SZ_Data ), "%s %d", SZ_Password_T[id], cs_get_user_money(id) )  
-     get_user_name(id, SZ_Name, 31 )  
-   
-     fvault_set_data( Vault, SZ_Name, SZ_Data )  
-   
-     return PLUGIN_CONTINUE;  
- }  
-   
- public Load(id)  
- {  
-     static SZ_Data[ 512 ], SZ_Name[ 32 ], SETINFO_Password[ 191 ], VAULT_Password[ 191 ], Dinero[ 11 ] 
-   
-     get_user_name(id, SZ_Name, 31 ) 
-     get_user_info(id, "_pass", SETINFO_Password, 190 ) 
-   
-     if( !fvault_get_data( Vault, SZ_Name, SZ_Data, charsmax( SZ_Data ) ) )  
-         return 0; 
-   
-     Registrado[id] = 1  
-   
-     parse( SZ_Data, VAULT_Password, 190, Dinero, 10 )   
-   
-     if( equal( SETINFO_Password, VAULT_Password ) )   
-     {  
-         SZ_Password_T[id] = SETINFO_Password  
-   
-         cs_set_user_money(id, str_to_num( Dinero ) )  
-   
-         return 2;  
-     }  
-     else   
-     {  
-         BadPassword[id] = 1  
-         set_hudmessage(255, 0, 0, -1.0, 0.15, 1, 6.0, 14.0)  
-         show_hudmessage(id, "Helytelen jelszó, próbálja újra");  
-     }  
-   
-     return 1;  
- }  
-   
- public FWClientUserInfoChanged(id, Buffer )  
- {  
-     if( !is_user_connected(id) )  
-         return FMRES_IGNORED;  
-   
-     static NickName[32], NickOld[32]; get_user_name(id, NickOld, 31 )  
-     engfunc( EngFunc_InfoKeyValue, Buffer, "name", NickName, 31 )   
-   
-     if( equal( NickName, NickOld ) )  
-         return FMRES_IGNORED;  
-   
-     engfunc( EngFunc_SetClientKeyValue,id, Buffer, "name", NickOld )   
-   
-     client_cmd(id, "name ^"%s^"; setinfo name ^"%s^"", NickOld, NickOld )  
-   
-     return FMRES_SUPERCEDE;  
- }    
-   
- public BlockBuyCommands(id)   
- {   
-     if (!get_pcvar_num(gCvarPluginToggle))   
-         return PLUGIN_CONTINUE;   
-   
-     return PLUGIN_HANDLED;   
- }   
-   
- public Ham_PlayerSpawn(id)   
- {   
-     new players[32], num 
-     get_players(players, num, "a") 
-   
-     for( --num; num >= 0; num-- ) /* By ConnorMcLeod */ 
-     { 
-         fm_strip_user_weapons(players[num]) 
-     }    
- }   
-   
- public Event_CurWeapon( id )   
- {   
-     if(get_pcvar_num(cvar_active))   
-     {   
-         new he = read_data(2)   
-   
-         if(he == CSW_HEGRENADE && is_user_alive(id))   
-   
-         return PLUGIN_CONTINUE   
-   
-         else   
-         {   
-             set_task(0.1, "he", id)   
-         }   
-     }   
-     else   
-     {   
-         return PLUGIN_CONTINUE;   
-     }   
-     return PLUGIN_HANDLED;   
- }   
-   
- public he(id)   
-     give_item(id,"weapon_hegrenade")  
-   
- fm_strip_user_weapons( id ) { 
-     new iEnt = engfunc( EngFunc_CreateNamedEntity, engfunc( EngFunc_AllocString, "player_weaponstrip" ) ); 
-   
-     if( !pev_valid( iEnt ) ) 
-         return 0; 
-   
-     dllfunc( DLLFunc_Spawn, iEnt ); 
-     dllfunc( DLLFunc_Use, iEnt, id ); 
-     engfunc( EngFunc_RemoveEntity, iEnt ); 
-   
-     return 1; 
- } 
-   
- /* By GHW_Chronic  */ 
-   
- public respawn_player(id) 
- { 
-     if(is_user_connected(id)) 
-     { 
-         set_pev(id,pev_deadflag,DEAD_RESPAWNABLE); 
-         set_pev(id, pev_iuser1, 0); 
-         dllfunc(DLLFunc_Think,id) 
-   
-         engfunc(EngFunc_SetOrigin,id,Float:{-4800.0,-4800.0,-4800.0}) 
-   
-         set_task(0.5,"spawnagain",id) 
-     } 
- } 
-   
- public spawnagain(id) 
- { 
-     if(is_user_connected(id)) 
-     { 
-         spawn(id) 
-         dllfunc(DLLFunc_Spawn,id) 
-     } 
- }   
-   
- /* XP Mod edit by VodKa' */ 
- /* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE 
- *{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang11274\\ f0\\ fs16 \n\\ par } 
- */ 
-