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

What happens if we keep the id as a negative value?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
prinoybullboy
Member
Join Date: Aug 2014
Old 12-22-2017 , 04:29   What happens if we keep the id as a negative value?
Reply With Quote #1

What happens if we keep the id as a negative value like -1 ?
prinoybullboy is offline
DjSoftero
Veteran Member
Join Date: Nov 2014
Location: Lithuania
Old 12-22-2017 , 04:51   Re: What happens if we keep the id as a negative value?
Reply With Quote #2

where do you plan using id, and what id are you talking about. Show a code as an example.
__________________
retired chump
DjSoftero is offline
E1_531G
Senior Member
Join Date: Dec 2017
Old 12-22-2017 , 05:34   Re: What happens if we keep the id as a negative value?
Reply With Quote #3

Quote:
Originally Posted by prinoybullboy View Post
What happens if we keep the id as a negative value like -1 ?
If you have: id = -1;
and try: get_user_weapon(id); (or another function that concerns to the player)
you will see the error (on runtime): Invalid player (or entity).
__________________
My English is A0

Last edited by E1_531G; 12-24-2017 at 07:27.
E1_531G is offline
killerZM
Senior Member
Join Date: Sep 2016
Old 12-22-2017 , 06:43   Re: What happens if we keep the id as a negative value?
Reply With Quote #4

i am not sure
but it give error because there no player has the id -1 on server
or -1 isn't valid id
from 0 to 31
killerZM is offline
E1_531G
Senior Member
Join Date: Dec 2017
Old 12-22-2017 , 09:45   Re: What happens if we keep the id as a negative value?
Reply With Quote #5

Quote:
Originally Posted by killerZM View Post
i am not sure
but it give error because there no player has the id -1 on server
or -1 isn't valid id
from 0 to 31
Valid id are from 1 to MaxPLayers.
Like: 1 <= id <= get_maxplayers()
__________________
My English is A0

Last edited by E1_531G; 12-22-2017 at 09:47.
E1_531G is offline
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 12-24-2017 , 05:27   Re: What happens if we keep the id as a negative value?
Reply With Quote #6

is_user_alive won't will throw any error.
__________________








CrazY. is offline
E1_531G
Senior Member
Join Date: Dec 2017
Old 12-24-2017 , 07:24   Re: What happens if we keep the id as a negative value?
Reply With Quote #7

Quote:
Originally Posted by CrazY. View Post
is_user_alive won't will throw any error.
Yes. My mistake, i was thinking about other thing. Should be set/get_user_something. Fixed.
__________________
My English is A0
E1_531G 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 16:42.


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