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

Checking for the existence of weapons


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Drimacus
Member
Join Date: Jun 2011
Old 06-22-2011 , 09:27   Checking for the existence of weapons
Reply With Quote #1

PHP Code:
IsValidEntity(ActiveWeapon
and
PHP Code:
ActiveWeapon != -
the same actions, but written in different ways?
Drimacus is offline
Pawn 3-pg
Senior Member
Join Date: Jul 2009
Old 06-22-2011 , 09:38   Re: Checking for the existence of weapons
Reply With Quote #2

They are not the same (because -1 isn't the only invalid index), but almost every function that returns an entity will only return either a valid entity index, or -1.

Most of the time, you can get away with just making sure that the entity isn't -1.
Pawn 3-pg is offline
lokizito
Veteran Member
Join Date: Dec 2010
Location: Brazil
Old 06-23-2011 , 16:14   Re: Checking for the existence of weapons
Reply With Quote #3

As Pawn 3-pg said not same. Better use IsValidEntity so you can be sure that is valid.
__________________
[CS:S] RankMe - Why pay for a rank plugin if you can have one for free?
[CS:S] RankMe Connect Announcer - Announce when a player connect
Translation Project - Let's make the plugins to be international
lokizito 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 01:18.


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