Member type: var_frags Float -> Integer #336
-
Может быть стоит сменить тип данных, просто мне не понятно зачем значение float передавать? |
Beta Was this translation helpful? Give feedback.
Replies: 8 comments
-
Переделал на 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)
}
} |
Beta Was this translation helpful? Give feedback.
-
Because it has float type in the engine. |
Beta Was this translation helpful? Give feedback.
-
@theAsmodai, why this member has float type in the engine? Is it necessary? |
Beta Was this translation helpful? Give feedback.
-
@Phantomsq, ask John Carmack. |
Beta Was this translation helpful? Give feedback.
-
We can make |
Beta Was this translation helpful? Give feedback.
-
@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), соответственно если нужно будет преобразование типа данных просто указать в последнем аргументе тип данных. |
Beta Was this translation helpful? Give feedback.
-
Зачем все усложнять ? Добавив тонна нативов и.т.д. Как по мне сейчас все норм |
Beta Was this translation helpful? Give feedback.
-
@Vaqtincha it can be done without adding new natives, we can make this as an 3rd-party .inc. Current natives aren't type-safe. |
Beta Was this translation helpful? Give feedback.
Because it has float type in the engine.