AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Enum warning (https://forums.alliedmods.net/showthread.php?t=309758)

draft 08-06-2018 06:01

Enum warning
 
Please, help me to fix 2 enum warnings in stocks. The code is below:
PHP Code:


enum CS_Internal_Models
{
    
CS_DONTCHANGE 0,
    
CS_CT_URBAN 1,
    
CS_T_TERROR 2,
    
CS_T_LEET 3,
    
CS_T_ARCTIC 4,
    
CS_CT_GSG9 5,
    
CS_CT_GIGN 6,
    
CS_CT_SAS 7,
    
CS_T_GUERILLA 8,
    
CS_CT_VIP 9,
    
CZ_T_MILITIA 10,
    
CZ_CT_SPETSNAZ 11
}

enum CS_Teams
{
    
CS_TEAM_UNASSIGNED 0,
    
CS_TEAM_T 1,
    
CS_TEAM_CT 2,
    
CS_TEAM_SPECTATOR 3
}

...

stock fm_set_user_teamid, {CS_Teams,_}:team, {CS_Internal_Models,_}:model CS_DONTCHANGE )
{
    if( !
is_user_connectedid ) ) return 0

    set_pdata_int
idOFFSET_TEAM_:teamOFFSET_LINUX )
 
    if( 
model )
    {
        
set_pdata_intidOFFSET_MODEL_:modelOFFSET_LINUX )
    }

    
dllfuncDLLFunc_ClientUserInfoChangedidengfuncEngFunc_GetInfoKeyBufferid ) )

    
emessage_begin    MSG_BROADCASTg_msgid_teaminfo )
    
ewrite_byte        id )
    
ewrite_string    CS_Team_Name[_:team] )
    
emessage_end    ( )

    return 
1
}

//stock CS_Teams:fm_get_user_team( id, &{CS_Internal_Models,_}:model = CS_DONTCHANGE )
stock CS_Teams:fm_get_user_teamid )
{
    if( !
is_user_connectedid ) ) return CS_TEAM_UNASSIGNED

    
//return CS_Teams:get_pdata_int( id, OFFSET_TEAM, OFFSET_LINUX )
    
return CS_Teams:get_pdata_intidOFFSET_TEAMOFFSET_LINUX )


The warning is shown at
"stock fm_set_user_team( id, {CS_Teams,_}:team, {CS_Internal_Models,_}:model = CS_DONTCHANGE )"
and
" return CS_Teams:get_pdata_int( id, OFFSET_TEAM, OFFSET_LINUX )"

(tag mismatch)

HamletEagle 08-06-2018 06:23

Re: Enum warning
 
Use cs_get/set_user_team.

draft 08-06-2018 06:46

Re: Enum warning
 
This is not the answer, i need to fix warnings in this code without cstrike module, only fakemeta and amxmodx.

klippy 08-06-2018 06:54

Re: Enum warning
 
No, use cstrike.

Ghosted 08-06-2018 06:56

Re: Enum warning
 
Just remove enum names, they are useless, or change
Code:

stock fm_set_user_team( id, {CS_Teams,_}:team, {CS_Internal_Models,_}:model = CS_DONTCHANGE )
to
Code:

stock fm_set_user_team( id, any:team, any:model = CS_DONTCHANGE )

HamletEagle 08-06-2018 07:49

Re: Enum warning
 
Quote:

Originally Posted by draft (Post 2608520)
This is not the answer, i need to fix warnings in this code without cstrike module, only fakemeta and amxmodx.

You could completely remove amxmodx and write directly metamod plugins. NO MODULES USED, HOW COOL IS THAT?

draft 08-06-2018 08:57

Re: Enum warning
 
Quote:

Originally Posted by Ghosted (Post 2608524)
Just remove enum names, they are useless, or change
Code:

stock fm_set_user_team( id, {CS_Teams,_}:team, {CS_Internal_Models,_}:model = CS_DONTCHANGE )
to
Code:

stock fm_set_user_team( id, any:team, any:model = CS_DONTCHANGE )

Thanks!

Quote:

You could completely remove amxmodx and write directly metamod plugins. NO MODULES USED, HOW COOL IS THAT?
Man, if you don't know, how to help, than just go to the next topic. I'm not interested in opinion of the guy that joined in 2013 since i'm here in 2007 and already have my own opinion what modules i should use. In this case i'm fixing not my own plugin and i have no rights to add any other modules.

HamletEagle 08-06-2018 10:01

Re: Enum warning
 
I am not willing to start a fight over nothing or get into a popularity contest. I just want to state that considering your current question I probably have a more sane point of view regarding how things should be done than you. Join date does not mean anything.
How comes you don't have the right to add any other modules when cstrike is a default module, nothing needs to be added?

Anyway, you do you, I can't stop anyone from doing stupid things.


All times are GMT -4. The time now is 12:26.

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