Checking if a entity is certain weapon
first of all, sry for bad english.
mkay, i have an entity index and i want to check if its deagle. Code:
public plugin_init( ) { Code:
client_print( 0, print_chat, "%s", pev( ent, pev_classname ) ); i also tried to check if ent == CSW_DEAGLE although i know this function returns me the id of the entity, and it didn't work. thanks :) |
Re: Checking if a entity is certain weapon
Why would you even need to check? It's very redundant because you're hooking deagle.
BTW, you're using pev_classname wrong. It should be: PHP Code:
|
Re: Checking if a entity is certain weapon
RegisterHam( Ham_Weapon_PrimaryAttack, "weapon_deagle", "OnDeagleAttack", 1 );
weapon_deagle is the classname for what you are registering your hook, so it will work only for deagles. What pev_classname gives you is a string, so you have to use it like pev( iEnt, pev_classname, szString, charsmax( szString ) ). Also, you have to create your szString variabile with a given size like new szString[ 20 ] or whatever. |
Re: Checking if a entity is certain weapon
Quote:
Quote:
anyway, thanks, i guess i forgot it works this way. you can lock this thread or whatever |
Re: Checking if a entity is certain weapon
Why you would need a check for something that you already know ? It doesn't make sense.
|
Re: Checking if a entity is certain weapon
Quote:
Code:
new const WeaponsInfo[ ] [ Weapons ] = Code:
for( new i = 0 ; i < sizeof( Weapons_Attacks ) ; i++ ) |
Re: Checking if a entity is certain weapon
PHP Code:
|
Re: Checking if a entity is certain weapon
Quote:
|
Re: Checking if a entity is certain weapon
Quote:
PHP Code:
|
Re: Checking if a entity is certain weapon
Quote:
Code:
get_pdata_int |
All times are GMT -4. The time now is 13:33. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.