Raised This Month: $51 Target: $400
 12% 

cs_set_ent_class return


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 01-26-2017 , 10:05   cs_set_ent_class return
Reply With Quote #1

Hey, wouldn't it be better if cs_set_ent_class returned the entity index ? Currently there's no return.
__________________

Last edited by edon1337; 01-27-2017 at 06:53.
edon1337 is offline
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 01-26-2017 , 10:59   Re: cs_set_ent_class return
Reply With Quote #2

There's no return because it sets the classname as the native name suggests, it doesn't retrieve it, I don't understand your confusion.

Just use other ways that you have previously used to retrieve the classname of an entity, it's just that setting classname requires some additional logic within CS.

Last edited by klippy; 01-26-2017 at 10:59.
klippy is offline
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 01-26-2017 , 14:47   Re: cs_set_ent_class return
Reply With Quote #3

There's no confusion. Just it would be nice having that, instead of dealing with other natives, you can directly use cs_set_ent_class then use the return value for something else. At all, it costs nothing to the developers to add that.
__________________

Last edited by edon1337; 01-26-2017 at 14:48.
edon1337 is offline
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 01-26-2017 , 17:43   Re: cs_set_ent_class return
Reply With Quote #4

It doesn't make sense.
klippy is offline
Depresie
Veteran Member
Join Date: Nov 2013
Old 01-26-2017 , 17:44   Re: cs_set_ent_class return
Reply With Quote #5

Why you don't just use the engine alternatives ?
There is also fakemeta with which you can retrieve the classname
__________________

Last edited by Depresie; 01-26-2017 at 17:45.
Depresie is offline
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 01-27-2017 , 06:52   Re: cs_set_ent_class return
Reply With Quote #6

Quote:
Originally Posted by Depresie View Post
Why you don't just use the engine alternatives ?
There is also fakemeta with which you can retrieve the classname
Why not use find_ent_by_x instead of give_item ?

Because why to include engine when you can do it with give_item.

Example :
PHP Code:
new ent give_item(id"weapon_ak47")
cs_set_weapon_ammo(ent5
Anyways, I meant it to return the entity index not the entity itself, just like find_ent_by_x .
__________________

Last edited by edon1337; 01-27-2017 at 06:53.
edon1337 is offline
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 01-27-2017 , 07:44   Re: cs_set_ent_class return
Reply With Quote #7

Quote:
Originally Posted by edon1337 View Post
Anyways, I meant it to return the entity index not the entity itself, just like find_ent_by_x .
Entity index and entity are interchangeable in plugin contexts - there's no "the entity itself", only entity indexes are being used.

It makes no sense to return an entity index as that's what the native requires as a parameter in the first place. Why would you return something that you already have.
"set" natives aren't supposed to return anything (other than state/status, like a boolean for successful operation), they only set values, they don't retrieve them.
klippy 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 18:33.


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