Raised This Month: $135 Target: $400
 33% 

[FAQ]armoury_entity


Post New Thread Reply   
 
Thread Tools Display Modes
RateX
Veteran Member
Join Date: Jun 2012
Location: 0o. SEA .o0
Old 01-16-2015 , 21:55   Re: [FAQ]armoury_entity
Reply With Quote #11

^This explains why on fy_ maps, when you throw HE nade with weaponphys plugin(this plugin make nade blow stuffs away, including visible armoury_entity), the entities just refuse to respawn at where they originally were.
Thank you for spending time answering my question.
Keep up making great tuts.
RateX is offline
Aydeev
Junior Member
Join Date: Oct 2014
Old 01-19-2015 , 13:12   Re: [FAQ]armoury_entity
Reply With Quote #12

Quote:
Originally Posted by meTaLiCroSS View Post
PHP Code:
new armouryEnt = -1
while((armouryEnt find_ent_by_class(armouryEnt"armoury_entity"))
{
    
set_pdata_int(armouryEntm_iCount0XO_CArmoury);
    
set_pev(armouryEntpev_effectspev(armouryEntpev_effects) | EF_NODRAW);

Thank you!
Aydeev is offline
[email protected]
Veteran Member
Join Date: Jan 2010
Location: Russia, Ivanovo
Old 01-07-2018 , 13:01   Re: [FAQ]armoury_entity
Reply With Quote #13

Quote:
Originally Posted by HamletEagle View Post
An armoury_entity can hold more than one weapon.
weaponbox too.

Quote:
Originally Posted by HamletEagle View Post
The stock above will return -1 on failure.
Maybe better to throw an error? Who will check returned value? (almost always no one checks them)
__________________

Last edited by [email protected]; 01-07-2018 at 13:28.
PRoSToTeM@ is offline
Send a message via ICQ to PRoSToTeM@ Send a message via Skype™ to PRoSToTeM@
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 01-07-2018 , 14:20   Re: [FAQ]armoury_entity
Reply With Quote #14

Quote:
Originally Posted by [email protected] View Post
weaponbox too.
Kinda unrelated, this tutorial is about armoury_entity, why should I mention that weaponbox can have multiple weapons? It's mentioned in the proper place: https://forums.alliedmods.net/showthread.php?t=261464

Quote:
Originally Posted by [email protected] View Post
Maybe better to throw an error? Who will check returned value? (almost always no one checks them)
It's the coder job to properly check for return values. He gets burned once, then gets burned twice and finally he learns to look for the returned value.
__________________
HamletEagle is offline
[email protected]
Veteran Member
Join Date: Jan 2010
Location: Russia, Ivanovo
Old 01-07-2018 , 14:58   Re: [FAQ]armoury_entity
Reply With Quote #15

Quote:
Originally Posted by HamletEagle View Post
It's the coder job to properly check for return values. He gets burned once, then gets burned twice and finally he learns to look for the returned value.
Even pro coders from this forum forget to remove player task on client_disconnect, but it is a bit unrelated.
But IMO itemType check should throw an error, it's the coder job to use valid arguments (coder can validate args, but can't precontrol entity creation failure). Or return codes should be different, e.g entity creation failed is -1 and invalid itemType is -2, so you can differentiate them.

Quote:
Originally Posted by HamletEagle View Post
Kinda unrelated, this tutorial is about armoury_entity, why should I mention that weaponbox can have multiple weapons? It's mentioned in the proper place: https://forums.alliedmods.net/showthread.php?t=261464
This is written in the same paragraph with the comparison vs. weaponbox, so it sounds like armoury_entity can have multiple weapons, but weaponbox can't.
__________________

Last edited by [email protected]; 01-07-2018 at 15:02.
PRoSToTeM@ is offline
Send a message via ICQ to PRoSToTeM@ Send a message via Skype™ to PRoSToTeM@
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Traphouse
Old 01-07-2018 , 16:03   Re: [FAQ]armoury_entity
Reply With Quote #16

What exactly is the reason that some weapons such as Famas, Galil, Pistols etc.. can't be created as armoury_entity?
__________________
edon1337 is online now
Send a message via Skype™ to edon1337
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 01-07-2018 , 16:43   Re: [FAQ]armoury_entity
Reply With Quote #17

Quote:
Originally Posted by [email protected] View Post
This is written in the same paragraph with the comparison vs. weaponbox, so it sounds like armoury_entity can have multiple weapons, but weaponbox can't.
It's not a comparison, the paragraph just states that dropped weapons are not armoury_entity, but weaponbox.
I could edit to make it more clear, but the original intent was not a comparison by any means.

Quote:
Originally Posted by [email protected] View Post
Even pro coders from this forum forget to remove player task on client_disconnect, but it is a bit unrelated.
But IMO itemType check should throw an error, it's the coder job to use valid arguments (coder can validate args, but can't precontrol entity creation failure). Or return codes should be different, e.g entity creation failed is -1 and invalid itemType is -2, so you can differentiate them.
I feel like we are debating over nothing, the stock is not critical enough to bother. Also it's something I put together really fast to show how it can be done, people are free to create their own implementation.
The coder can't precontrol the creation of the entity, but he can check the returned value and only proceed if it succeeded. Not like you can do much if entity fails to create.
Moreover, anyone could add an error log into that stock if they need it.
If it bothers you that much, go and add an error log and I will edit my post.

Quote:
Originally Posted by edon1337 View Post
What exactly is the reason that some weapons such as Famas, Galil, Pistols etc.. can't be created as armoury_entity?
Because cs is coded like that. https://github.com/s1lentq/ReGameDLL...pons.cpp#L2165
__________________

Last edited by HamletEagle; 01-07-2018 at 16:44.
HamletEagle is offline
Reply


Thread Tools
Display Modes

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 10:48.


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