AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [ Solved ] Config (https://forums.alliedmods.net/showthread.php?t=75678)

xPaw 08-10-2008 06:48

[ Solved ] Config
 
how to include my config for plugin like. plugin_config.cfg from configs folder
and if file found, dont make new cvars with register_cvar

atomen 08-10-2008 07:07

Re: set_user_team in fakemeta & config
 
PHP Code:

#define OFFSET_TEAM     114

enum
{
    
CS_TEAM_UNASSIGNED 0,
    
CS_TEAM_T,
    
CS_TEAM_CT,
    
CS_TEAM_SPECTATOR
};

stock fm_set_user_team(index, {CsTeams,_}:teamupdate 1)
{
    
set_pdata_int(indexOFFSET_TEAM_:team);
    
set_pev(indexpev_team_:team);

    if(
update)
    {
        static 
_msg_teaminfo; if(!_msg_teaminfo_msg_teaminfo get_user_msgid("TeamInfo");
        static 
teaminfo[][] = { "UNASSIGNED""TERRORIST""CT""SPECTATOR" };
        
        
message_begin(MSG_ALL_msg_teaminfo);
        
write_byte(index);
        
write_string(teaminfo[_:team]);
        
message_end();
    }

    return 
1;



ot_207 08-10-2008 07:15

Re: set_user_team in fakemeta & config
 
Yes! That is the correct way.
But don't forget that linux and 64 bit proccecors have different offsets so it is important to use this ->
PHP Code:

#if cellbits == 32
#define OFFSET_TEAM        114
#else
#define OFFSET_TEAM        139
#endif

#define OFFSET_LINUX    5


get_pdata_int(id,OFFSET_TEAM,OFFSET_LINUX)
set_pdata_int(indexOFFSET_TEAM_:team,OFFSET_LINUX


xPaw 08-10-2008 07:17

Re: set_user_team in fakemeta & config
 
thanks +k, set_user_team solved :)

ot_207 08-10-2008 07:39

Re: config
 
PHP Code:

public plugin_init()
{
if (
file_exists(CFG))
{
register()...
}
else
server_print("ERROR! Config file not found")




Arkshine 08-10-2008 07:52

Re: config
 
Quote:

But don't forget that linux and 64 bit proccecors have different offsets so it is important to use this ->
As far I know, the hlds build for AMD64 is very very very old and not even supported by steam anymore. ( http://forums.alliedmods.net/showthread.php?t=46712 ) Also, AMX Mod X doesn't support AMD64. So, that's not important at all, it's just now pointless.

xPaw 08-10-2008 07:57

Re: config
 
okay, and how to exec it with amxx

ot_207 08-10-2008 08:04

Re: config
 
Quote:

Originally Posted by xPaw (Post 667411)
okay, and how to exec it with amxx

PHP Code:

// CFG_FILE is a string with the path to the config file
if(file_exists(CFG_FILE))
    
server_cmd("exec %s",CFG_FILE



All times are GMT -4. The time now is 05:39.

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