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

[solved] Frags,shield and invisibility issue


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
indraraj striker
Veteran Member
Join Date: Mar 2014
Location: Under the water
Old 08-27-2016 , 01:40   [solved] Frags,shield and invisibility issue
Reply With Quote #1

Frags: Scoreboard update after if i kill someone or direct in next round
is there any way to update instant

Shield : when i m having rifle gun at the time shield is not adding i did strip_user_weapon to remove rifle then give item shield etc may you have to check my below code but it works when i m having usp gun

Invisibility: tested with camera plugin and switch to 3rd person view
but it isnt showing as invisibility same as normal player

Code :
PHP Code:

#include < amxmodx > 
#include < fun >

public plugin_init()
{
register_clcmd("say /frag","get_a_frags");
register_clcmd("say /shield","get_a_shield");
register_clcmd("say /invi","get_a_inivisibility");
}

public 
get_a_frags(id)
{
//player should be alive to get frags
if(is_user_alive(id)) 
{
set_user_frags(id,get_user_frags(id) + 10);
client_print(id,print_chat,"Now i added frags");
}
}

public 
get_a_shield(id)
{
if(
is_user_alive(id))
{
strip_user_weapons(id); // removing his weapon to give shield
give_item(id,"weapon_usp"); 
give_item(id,"weapon_knife");
give_item(id,"weapon_shield");
client_print(id,print_chat,"Now i added shield");
}
}

public 
get_a_inivisibility(id)
{
if(
is_user_alive(id))
{
 
set_user_rendering(idkRenderFxNone000kRenderTransAlpha0);
 
client_print(id,print_chat,"Now i added invisibility");
}

Attached Files
File Type: sma Get Plugin or Get Source (not_working.sma - 387 views - 876 Bytes)
__________________
Thanks everyone. #miss_you_all

Last edited by indraraj striker; 12-26-2016 at 05:08. Reason: Edit : Shield description updated now everyone can understand :3
indraraj striker is offline
NiHiLaNTh
Way Past Expiration
Join Date: May 2009
Location: Latvia
Old 08-27-2016 , 07:17   Re: Frags,shield and invisibility issue
Reply With Quote #2

1) Best way to add frags is by using ExecuteHam(Ham_AddPoints, id, 10, 1). In this case 10 is frags to add, 1 is to allow player having negative scores.
2) How the hell player can have an assault rifle and shield at the same time?
3) Yeah, 3rd person camera messes up with players rendering.
__________________


Last edited by NiHiLaNTh; 08-27-2016 at 07:18.
NiHiLaNTh is offline
Send a message via Skype™ to NiHiLaNTh
indraraj striker
Veteran Member
Join Date: Mar 2014
Location: Under the water
Old 08-27-2016 , 09:22   Re: Frags,shield and invisibility issue
Reply With Quote #3

1) Thanks man it works
2) Man have you checked my code ?
3) okay i will try to test it with my friends
PHP Code:

strip_user_weapons
(id); // removing his rifle to give shield
give_item(id,"weapon_usp"); 
give_item(id,"weapon_knife");
give_item(id,"weapon_shield"); 
__________________
Thanks everyone. #miss_you_all

Last edited by indraraj striker; 08-27-2016 at 09:26.
indraraj striker is offline
NiHiLaNTh
Way Past Expiration
Join Date: May 2009
Location: Latvia
Old 08-27-2016 , 09:31   Re: Frags,shield and invisibility issue
Reply With Quote #4

Well I never messed up with the shield, so I can't tell exactly how to give it, but try using stock from this post.
__________________

NiHiLaNTh is offline
Send a message via Skype™ to NiHiLaNTh
indraraj striker
Veteran Member
Join Date: Mar 2014
Location: Under the water
Old 08-27-2016 , 09:48   Re: Frags,shield and invisibility issue
Reply With Quote #5

okay as you suggest me but i m getting this error undefined symbol : get_pdata_bool and also i checked fakemeta.inc there is no native with this name get_pdata_bool. I think this is for Amxmodx 1.8.3
i m using Amxmodx 1.8.2 [local compiled]
__________________
Thanks everyone. #miss_you_all
indraraj striker is offline
NiHiLaNTh
Way Past Expiration
Join Date: May 2009
Location: Latvia
Old 08-27-2016 , 10:52   Re: Frags,shield and invisibility issue
Reply With Quote #6

Yes, they are for 1.8.3.
This post has all need stocks.
__________________

NiHiLaNTh is offline
Send a message via Skype™ to NiHiLaNTh
Old 08-27-2016, 11:48
wickedd
This message has been deleted by wickedd. Reason: misread
Natsheh
Veteran Member
Join Date: Sep 2012
Old 08-27-2016 , 12:51   Re: Frags,shield and invisibility issue
Reply With Quote #7

Player can have a rifle and a sheild but its a long story siince it needs the models for each rifle
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
indraraj striker
Veteran Member
Join Date: Mar 2014
Location: Under the water
Old 08-28-2016 , 09:07   Re: Frags,shield and invisibility issue
Reply With Quote #8

@Natsheh i know it required models if you want shield for rifle
but what about this it does not add shield
PHP Code:

strip_user_weapons
(id); // removing his rifle to give shield
give_item(id,"weapon_usp"); 
give_item(id,"weapon_knife");
give_item(id,"weapon_shield"); 
__________________
Thanks everyone. #miss_you_all
indraraj striker is offline
indraraj striker
Veteran Member
Join Date: Mar 2014
Location: Under the water
Old 08-28-2016 , 09:21   Re: Frags,shield and invisibility issue
Reply With Quote #9

Quote:
Originally Posted by NiHiLaNTh View Post
Yes, they are for 1.8.3.
This post has all need stocks.
i didn't understand how to use it or is there any other way to achieve this
__________________
Thanks everyone. #miss_you_all
indraraj striker is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 08-28-2016 , 10:58   Re: Frags,shield and invisibility issue
Reply With Quote #10

That's the correct way to give a shield, same code as: https://github.com/s1lentq/ReGameDLL...ayer.cpp#L3071

For the stocks, you only need this part:
PHP Code:
#define INT_BYTES        4 
#define BYTE_BITS        8 

stock set_pdata_char(entcharbased_offsetvalueintbase_linuxdiff 5

    
value &= 0xFF 
    
new int_offset_value get_pdata_int(entcharbased_offset INT_BYTESintbase_linuxdiff
    new 
bit_decal = (charbased_offset INT_BYTES) * BYTE_BITS 
    int_offset_value 
&= ~(0xFF<<bit_decal// clear byte 
    
int_offset_value |= value<<bit_decal 
    set_pdata_int
(entcharbased_offset INT_BYTESint_offset_valueintbase_linuxdiff
    return 



stock set_pdata_bool(entcharbased_offsetbool:valueintbase_linuxdiff 5

    
set_pdata_char(entcharbased_offset_:valueintbase_linuxdiff



stock bool:get_pdata_bool(entcharbased_offsetintbase_linuxdiff 5

    return !!( 
get_pdata_int(entcharbased_offset INT_BYTESintbase_linuxdiff) & (0xFF<<((charbased_offset INT_BYTES) * BYTE_BITS)) ) 

Really, is that hard to copy/paste and use some functions?
__________________

Last edited by HamletEagle; 08-28-2016 at 10:59.
HamletEagle 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 15:19.


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