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

[STOCK] give_user_weapon


Post New Thread Reply   
 
Thread Tools Display Modes
Craxor
Veteran Member
Join Date: Jan 2016
Location: Romania
Old 05-13-2017 , 05:03   Re: [STOCK] give_user_weapon
Reply With Quote #31

as i know stock function simple let you acces functions from inc files.

Anyway, i uptdated the first topic, btw i should not remove the is_user_alive check? In most of the cases, anyway users add an is_user_alive() check because they do more stuff and they anyway cover this part.

ex:
if( if_user_alive(id))
{
give_user_weapon(...
set_user_health( ...
client_print..
etc...
}

they will anyway add is_user_alive
Craxor is offline
Send a message via ICQ to Craxor
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 05-13-2017 , 09:53   Re: [STOCK] give_user_weapon
Reply With Quote #32

I don't think it hurts anything leaving it there since it's inexpensive, but yes I agree with you.
__________________
Bugsy is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 05-13-2017 , 09:54   Re: [STOCK] give_user_weapon
Reply With Quote #33

Quote:
Originally Posted by Bugsy View Post
Just make it give knife... and no
I believe he meant #assert, not assert.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 05-13-2017 , 11:02   Re: [STOCK] give_user_weapon
Reply With Quote #34

Quote:
Originally Posted by OciXCrom View Post
I believe he meant #assert, not assert.
Valid point, but I still don't think it will work. I could be wrong, but I think this is only to validate that constants are set to valid values, not for checking dynamic parameter values passed into a function. I do not have experience with using assert, this is only an assumption.

http://forum.sa-mp.com/showthread.php?t=570948
PHP Code:
//Checks compile time constants are correct. 

//For example:
#assert MAX_PLAYERS > 32

//Is equivalent to:
#if MAX_PLAYERS <= 32
    #error
#endif 
__________________

Last edited by Bugsy; 05-13-2017 at 11:13.
Bugsy 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 00:58.


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