View Single Post
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 PRoSToTeM@ 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 PRoSToTeM@ 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