AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Help me PLEASE WITH PLUGIN CS 1.6 (https://forums.alliedmods.net/showthread.php?t=297619)

YaMus 05-19-2017 10:10

Help me PLEASE WITH PLUGIN CS 1.6
 
Hello every body, who can say me how i can give for player deagle with 1 ammo?!

give_item( id, "weapon_deagle")

i give this but deagle have 7 ammo how change this?
please write me!!!!

CrazY. 05-19-2017 19:26

Re: Help me PLEASE WITH PLUGIN CS 1.6
 
PHP Code:

#include <cstrike>

...

cs_set_user_bpammo(idCSW_DEAGLE1

EDIT: Ops.. you want the clip, to change the clip you need to add some codes, because when you reload the weapon, the clip return to the default value (in this case, 7). Take a look into my extra items.

OciXCrom 05-19-2017 19:31

Re: Help me PLEASE WITH PLUGIN CS 1.6
 
cs_set_weapon_ammo(give_item(id, "weapon_deagle"), 1)

YaMus 05-20-2017 07:57

Re: Help me PLEASE WITH PLUGIN CS 1.6
 
Thank you GUYS!!

edon1337 05-20-2017 09:56

Re: Help me PLEASE WITH PLUGIN CS 1.6
 
Quote:

Originally Posted by OciXCrom (Post 2521653)
cs_set_weapon_ammo(give_item(id, "weapon_deagle"), 1)

https://forums.alliedmods.net/showpo...23&postcount=9

Should be

Code:
new iEnt = give_item( id, "weapon_deagle") ; if( iEnt ) cs_set_weapon_ammo( iEnt, 1 ) ;

Or this (when you already have a weapon and want to change it's clip)

Code:
new iEnt = find_ent_by_owner( -1, "weapon_deagle", id ) ; if( iEnt ) cs_set_weapon_ammo( iEnt, 1 ) ;

Or by Fakemeta (&Engine)

Code:
new iEnt = find_ent_by_owner( -1, "weapon_deagle", id ) ; if( iEnt ) set_pdata_int( iEnt, 51, 1, 4 ) ;


All times are GMT -4. The time now is 01:21.

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