Raised This Month: $ Target: $400
 0% 

2 FMprethink


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 04-07-2009 , 15:56   Re: 2 FMprethink
Reply With Quote #1

Quote:
Originally Posted by Dores View Post
At plugin_init, cvars' values will stay as default unless the admin edits the .sma, so in my opinion it's pointless checking a cvar's value at plugin_init...
If they are changed and the server doesn't crash, they will be the same value as they were the map before.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
One
Veteran Member
Join Date: Oct 2008
Location: Hardstyle-eSports.de
Old 04-07-2009 , 16:00   Re: 2 FMprethink
Reply With Quote #2

the problem is, i wont to strip users on spawn. this works but the main plugin dont work... ) haha

PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"

new g_iFhKeyValue
public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
unregister_forward(FM_KeyValueg_iFhKeyValue)
    
set_cvar_float("sv_restart"1.0)

    
pause("ad")
}



public 
plugin_precache()
{
    new 
iEnt

    iEnt 
engfuncEngFunc_CreateNamedEntityengfuncEngFunc_AllocString "player_weaponstrip" ) )
    
SetKeyValue(iEnt"origin""9999 9999 9999""player_weaponstrip")
    
SetKeyValue(iEnt"targetname""stripper""player_weaponstrip")
    
dllfunc(DLLFunc_SpawniEnt)

    
iEnt engfuncEngFunc_CreateNamedEntityengfuncEngFunc_AllocString "game_player_equip" ) )
    
SetKeyValue(iEnt"weapon_knife""1""game_player_equip")
    
SetKeyValue(iEnt"weapon_deagle""1""game_player_equip")
    
SetKeyValue(iEnt"ammo_50ae""5""game_player_equip")
    
SetKeyValue(iEnt"weapon_m3""1""game_player_equip")
    
SetKeyValue(iEnt"ammo_buckshot""4""game_player_equip")
    
SetKeyValue(iEnt"targetname""equipment""game_player_equip")
    
dllfunc(DLLFunc_SpawniEnt)

    
iEnt engfuncEngFunc_CreateNamedEntityengfuncEngFunc_AllocString "multi_manager" ) )
    
SetKeyValue(iEnt"stripper""0""multi_manager")
    
SetKeyValue(iEnt"equipment""1""multi_manager")
    
SetKeyValue(iEnt"targetname""game_playerspawn""multi_manager")
    
SetKeyValue(iEnt"spawnflags""1""multi_manager")
    
dllfunc(DLLFunc_SpawniEnt)

    
iEnt engfuncEngFunc_CreateNamedEntityengfuncEngFunc_AllocString "info_map_parameters" ) )
    
SetKeyValue(iEnt"buying""3""info_map_parameters")
    
dllfunc(DLLFunc_SpawniEnt)

    
g_iFhKeyValue register_forward(FM_KeyValue"KeyValue")
}

SetKeyValue(iEnt, const szKey[], const szValue[], const szClassName[])
{
    
set_kvd(0KV_ClassNameszClassName)
    
set_kvd(0KV_KeyNameszKey)
    
set_kvd(0KV_ValueszValue)
    
set_kvd(0KV_fHandled0)
    
dllfunc(DLLFunc_KeyValueiEnt0)
}

public 
KeyValue(iEntkvd_handle)
{
    if( 
pev_valid(iEnt) )
    {
        static 
szClassName[20]
        
get_kvd(kvd_handleKV_ClassNameszClassNamecharsmax(szClassName))
        if(    
equal(szClassName"game_player_equip")
        ||    
equal(szClassName"info_map_parameters")
        ||    
equal(szClassName"player_weaponstrip")    )
        {
            
engfuncEngFunc_RemoveEntityiEnt )
            return 
FMRES_SUPERCEDE
        
}
    }
    return 
FMRES_IGNORED

__________________
One is offline
Send a message via ICQ to One Send a message via AIM to One Send a message via MSN to One Send a message via Yahoo to One Send a message via Skype™ to One
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 02:25.


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