Raised This Month: $ Target: $400
 0% 

[ Solved ] Config


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 08-10-2008 , 06:48   [ Solved ] Config
Reply With Quote #1

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
__________________

Last edited by xPaw; 08-26-2008 at 09:04.
xPaw is offline
atomen
Veteran Member
Join Date: Oct 2006
Location: Stockholm, Sweden
Old 08-10-2008 , 07:07   Re: set_user_team in fakemeta & config
Reply With Quote #2

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;

__________________
atomen is offline
Send a message via MSN to atomen
ot_207
Veteran Member
Join Date: Jan 2008
Location: Romania The Love Country
Old 08-10-2008 , 07:15   Re: set_user_team in fakemeta & config
Reply With Quote #3

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
__________________
My approved plug-ins | Good for newbies! | Problems?

Back, will come around when I have time.
ot_207 is offline
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 08-10-2008 , 07:17   Re: set_user_team in fakemeta & config
Reply With Quote #4

thanks +k, set_user_team solved
__________________
xPaw is offline
ot_207
Veteran Member
Join Date: Jan 2008
Location: Romania The Love Country
Old 08-10-2008 , 07:39   Re: config
Reply With Quote #5

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


__________________
My approved plug-ins | Good for newbies! | Problems?

Back, will come around when I have time.
ot_207 is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 08-10-2008 , 07:52   Re: config
Reply With Quote #6

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.
__________________
Arkshine is offline
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 08-10-2008 , 07:57   Re: config
Reply With Quote #7

okay, and how to exec it with amxx
__________________
xPaw is offline
ot_207
Veteran Member
Join Date: Jan 2008
Location: Romania The Love Country
Old 08-10-2008 , 08:04   Re: config
Reply With Quote #8

Quote:
Originally Posted by xPaw View Post
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
__________________
My approved plug-ins | Good for newbies! | Problems?

Back, will come around when I have time.
ot_207 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 05:39.


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