Raised This Month: $ Target: $400
 0% 

[Request] Block Usp Damage


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 10-08-2021 , 12:53   Re: [Request] Block Usp Damage
Reply With Quote #5

Not sure how you do not see the issue. Your version creates 4 DIFFERENT game_player_equip entities. One where you dispatch "item_assaultsuit" keyvalue, another one where you dispatch "weapon_knife" key value, another one where you dispatch "weapon_elite" keyvalue and another one that you actually call spawn on.

Ignore the fact that you wrote everything on one line(which is a bad thing to do btw) and I split it into multiple lines. Look at what is passed inside Dispatch* calls(this is what your code translates to after preprocessing):
Code:
DispatchKeyValue( create_entity("game_player_equip"), "item_assaultsuit", "1" ) && DispatchKeyValue( create_entity("game_player_equip"), "weapon_knife", "1" ) && DispatchKeyValue( create_entity("game_player_equip"), "weapon_elite", "5" ) && DispatchSpawn(create_entity("game_player_equip"));

#define is a textual replacement. Every single appearance of "ent" inside the sma file is replaced by create_entity(). Define does not create a variable. The code I posted creates only one entity because create_entity() is called only once and saved inside a variable.
I suggest you read about #define and the preprocessor. Here, it may appear that it works because the effect is you create 4 entities, but in other causes it could seriously mess up your code and you'll have no clue why.
__________________

Last edited by HamletEagle; 10-08-2021 at 13:03.
HamletEagle is offline
 



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 23:57.


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