Raised This Month: $ Target: $400
 0% 

Enum warning


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
draft
Senior Member
Join Date: Jul 2007
Location: Russia, Saint-Petersburg
Old 08-06-2018 , 06:01   Enum warning
Reply With Quote #1

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)
__________________
draft is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 08-06-2018 , 06:23   Re: Enum warning
Reply With Quote #2

Use cs_get/set_user_team.
__________________
HamletEagle is offline
draft
Senior Member
Join Date: Jul 2007
Location: Russia, Saint-Petersburg
Old 08-06-2018 , 06:46   Re: Enum warning
Reply With Quote #3

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

Last edited by draft; 08-06-2018 at 06:47.
draft is offline
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 08-06-2018 , 06:54   Re: Enum warning
Reply With Quote #4

No, use cstrike.
__________________
klippy is offline
Ghosted
Veteran Member
Join Date: Apr 2015
Location: Georgia
Old 08-06-2018 , 06:56   Re: Enum warning
Reply With Quote #5

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 )
__________________

[MOD] CS Weapon Mod V1.7.1
[MM] MetaMod-C V1.0
[MOD] CS NPC Mod (5%)


Probably Left AM
Ghosted is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 08-06-2018 , 07:49   Re: Enum warning
Reply With Quote #6

Quote:
Originally Posted by draft View Post
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?
__________________

Last edited by HamletEagle; 08-06-2018 at 07:49.
HamletEagle is offline
draft
Senior Member
Join Date: Jul 2007
Location: Russia, Saint-Petersburg
Old 08-06-2018 , 08:57   Re: Enum warning
Reply With Quote #7

Quote:
Originally Posted by Ghosted View Post
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.
__________________
draft is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 08-06-2018 , 10:01   Re: Enum warning
Reply With Quote #8

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.
__________________

Last edited by HamletEagle; 08-06-2018 at 10:03.
HamletEagle 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 03:03.


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