Raised This Month: $32 Target: $400
 8% 

pev function return type


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Clauu
Senior Member
Join Date: Feb 2008
Location: RO
Old 01-27-2018 , 06:33   pev function return type
Reply With Quote #1

Hi, does pev function returns status of operation? As i see here https://www.amxmodx.org/api/fakemeta/pev it is not clear for me
For ex
Code:
p = pev(id, pev_origin,Float:array)
If id is not valid or for any reason the origin could not be retrieved, will
Code:
p
be set to 0/1 ?

Last edited by Clauu; 01-27-2018 at 06:41.
Clauu is offline
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 01-27-2018 , 06:37   Re: pev function return type
Reply With Quote #2

If id is not valid, an error will be thrown and will return 0, not sure. Also, your code it's wrong, the right way will be:

Code:
new Float:origin[3] pev(id, pev_origin, origin)
__________________








CrazY. is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 01-27-2018 , 06:47   Re: pev function return type
Reply With Quote #3

It will return 0 on error and 1 on success if the 3rd parameter was a float
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
E1_531G
Senior Member
Join Date: Dec 2017
Old 01-27-2018 , 08:03   Re: pev function return type
Reply With Quote #4

Look here: https://github.com/alliedmodders/amx...a/pev.cpp#L161
Maybe this will help you.

For int it returns value.
For float - status (fail or success/0 or 1).
For string - his length.
__________________
My English is A0
E1_531G is offline
Clauu
Senior Member
Join Date: Feb 2008
Location: RO
Old 01-27-2018 , 11:08   Re: pev function return type
Reply With Quote #5

It is clear to me now, thank you guys!
Clauu 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 18:24.


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