Skip to content

Member type: var_frags Float -> Integer #56

Closed

Description

@jesuspunk

Может быть стоит сменить тип данных, просто мне не понятно зачем значение float передавать?

Activity

  1. jesuspunk commented on Mar 2, 2017

    @jesuspunk
    Author

    Переделал на float тип данных перестало отображаться в табе количество фрагов всегда 0, но по id получает все верно.

    player_setScore(id, iAddFrags, iAddDeaths)
    {
    //new iFrags = get_user_frags(id)
    //reapi
    new Float:iFrags = get_entvar(id,var_frags)
    client_print(id,print_chat,"%f",iFrags)
    //new iDeaths = cs_get_user_deaths(id)
    //reapi
    new iDeaths = get_member(id,m_iDeaths)

    if(iAddFrags != 0)
    {
    	iFrags += float(iAddFrags)
    	//set_user_frags(id, iFrags)
                set_entvar(id,var_frags,iFrags)
    }
    
  2. theAsmodai commented on Mar 2, 2017

    @theAsmodai
    Collaborator

    Because it has float type in the engine.

  3. hajimura commented on Mar 2, 2017

    @hajimura

    @theAsmodai, why this member has float type in the engine? Is it necessary?

  4. theAsmodai commented on Mar 2, 2017

    @theAsmodai
    Collaborator

    @Phantomsq, ask John Carmack.

  5. WPMGPRoSToTeMa commented on Mar 2, 2017

    @WPMGPRoSToTeMa
    Contributor

    We can make get_entvar_int, get_entvar_float, etc. (+set) as in engine module, but with more type-safety and auto-converting float<->int. This can be done via default get_entvar directly in .inc.

  6. jesuspunk commented on Mar 3, 2017

    @jesuspunk
    Author

    @WPMGPRoSToTeMa If you can do it I think it will be great for me, but you need to at least hold a vote among scripters need it and how it will affect the speed of the engine, which is better amxx in the data lead to the desired type or here such conversions. So how to make it 1 standard to not have one in the float data writes, the other to an integer, and черт ногу сломит, where, in what place he what type of uses.

    Можно я по русски, а то тяжело на не родном языке писать... На мой взгляд конструкция get_entvar(id,var_*****,def_type_data=float), set_entvar(id,var_*,,def_type_data=float), соответственно если нужно будет преобразование типа данных просто указать в последнем аргументе тип данных.

  7. WPMGPRoSToTeMa commented on Mar 3, 2017

    @WPMGPRoSToTeMa
    Contributor

    @Vaqtincha it can be done without adding new natives, we can make this as an 3rd-party .inc. Current natives aren't type-safe.

  8. locked and limited conversation to collaborators on Nov 21, 2024
  9. converted this issue into a discussion #336 on Nov 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Resolution: 🚫 wontfixThe issue will not be fixed; the task is closed.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions