AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [ HELP ] cs_set_user_bpammo and cs_set_weapon_ammo error? (https://forums.alliedmods.net/showthread.php?t=273017)

Banana. 10-10-2015 21:36

[ HELP ] cs_set_user_bpammo and cs_set_weapon_ammo error?
 
How to fix my code to when zp_extra_item_selected() set user bpammo to 5 and set weapon ammo to 1?
PHP Code:

public zp_extra_item_selected(playeritemid)
{
    if(
itemid == g_item_id)
    {
        if(
get_user_weapon(player) == CSW_AWP)
        {
            
drop_prim(player);
        }

        
g_has_anti[player] = true;
        
client_print(playerprint_chat"[ZP] Voce comprou a Antidote AWP.");
        
give_item(player"weapon_awp");
        
cs_set_user_bpammo(playerCSW_AWP5);
        
cs_set_weapon_ammo(CSW_AWP1);
    } 



Depresie 10-10-2015 22:44

Re: [ HELP ] cs_set_user_bpammo and cs_set_weapon_ammo error?
 
so what is not working?

Banana. 10-11-2015 10:19

Re: [ HELP ] cs_set_user_bpammo and cs_set_weapon_ammo error?
 
I fixed the code , but when the player reloads the bpammo changes to 30 and the ammo changes to 10 , how to fix ?
PHP Code:

public zp_extra_item_selected(playeritemid)
{
    if(
itemid == g_item_id)
    {
        if(
get_user_weapon(player) == CSW_AWP)
        {
            
drop_prim(player);
        }

        
g_has_anti[player] = true;
        
client_print(playerprint_chat"[ZP] Voce comprou a Antidote AWP.");
        new 
weaponid give_item(player"weapon_awp");
        
cs_set_weapon_ammo(weaponid1);
        
cs_set_user_bpammo(playerCSW_AWP5);
    } 



wickedd 10-11-2015 10:53

Re: [ HELP ] cs_set_user_bpammo and cs_set_weapon_ammo error?
 
If you search the forum you will find a plugin that does this already. Just use it or look at it for reference.


All times are GMT -4. The time now is 22:12.

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