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

OciXCrom's Custom Shop + API


Post New Thread Reply   
 
Thread Tools Display Modes
Abdelrhmanreda170
Junior Member
Join Date: Jun 2018
Old 03-06-2020 , 12:46   Re: OciXCrom's Custom Shop + API
Reply With Quote #251

I want to add deadlyshot plugin in cshop
but i always get a error when compile it

here is the plugin , please make it
Attached Files
File Type: sma Get Plugin or Get Source (zp_extra_deadly-shot1.sma - 220 views - 2.8 KB)
__________________
J17

Last edited by Abdelrhmanreda170; 03-06-2020 at 12:49.
Abdelrhmanreda170 is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 03-06-2020 , 13:24   Re: OciXCrom's Custom Shop + API
Reply With Quote #252

PHP Code:
#include <amxmodx>
#include <engine>
#include <fakemeta>
#include <hamsandwich>
#include <customshop>

#define TASK_HUD 5345634
#define TASK_REMOVE 2423423

new bool:has_item[33]
new 
bool:using_item[33]

new 
sync_hud1
new cvar_deadlyshot_time


additem g_deadlyshot

public plugin_init()
{
    
// Edit by OciXCrom: converted for Custom Shop
    
register_plugin("[CSHOP] Extra Item: Deadly Shot (Human)""1.0""Dias")

    
register_event("HLTV""event_newround""a""1=0""2=0")
    
RegisterHam(Ham_TraceAttack"player""fw_traceattack")

    
cvar_deadlyshot_time register_cvar("ds_time""20.0")

    
sync_hud1 CreateHudSyncObj(random_num(110))
}

public 
plugin_precache()
{
    
g_deadlyshot cshop_register_item("deadlyshot""Deadly Shot"160001)
}

public 
event_newround(id)
{
    
remove_ds(id)
}

public 
cshop_item_selected(iditemid)
{
    if(
itemid == g_deadlyshot)
    {
        if(!
has_item[id] || using_item[id])
        {
            
client_print(idprint_chat"[ZP] You bought Deadly Shot !!!")

            
has_item[id] = true
            using_item
[id] = false

            set_task
(0.1"show_hud"id+TASK_HUD__"b")
        } else {
            
client_print(idprint_chat"[ZP] You can't buy Deadly Shot at this time...")
        }
    }
}

public 
cshop_item_removed(iditemid)
{
    if(
itemid == g_deadlyshot)
    {
        
remove_ds(id)
    }
}

public 
show_hud(id)
{
    
id -= TASK_HUD

    set_hudmessage
(02550, -1.00.8802.01.0)

    if(
has_item[id])
    {
        
ShowSyncHudMsg(idsync_hud1"[E] -> Active Deadly Shot")
    } else if(
using_item[id]) {
        
ShowSyncHudMsg(idsync_hud1"Deadly Shot - Actived")
    } else {
        
set_hudmessage(02550, -1.00.8802.05.0)
        
ShowSyncHudMsg(idsync_hud1"Deadly Shot - Disable")
        if(
task_exists(id+TASK_HUD)) remove_task(id+TASK_HUD)
    }
}

public 
client_PostThink(id)
{
    static 
Button
    Button 
get_user_button(id)

    if(
Button IN_USE)
    {
        if(
has_item[id] && !using_item[id])
        {
            
has_item[id] = false
            using_item
[id] = true

            set_task
(get_pcvar_float(cvar_deadlyshot_time), "remove_headshot_mode"id+TASK_REMOVE)
        }
    }
}

public 
fw_traceattack(victimattackerFloat:damagedirection[3], traceresultdmgbits)
{
    if(
using_item[attacker])
    {
        
set_tr2(traceresultTR_iHitgroupHIT_HEAD)
    }
}

public 
remove_ds(id)
{
    if(
has_item[id] || using_item[id])
    {
        
has_item[id] = false
        using_item
[id] = false

        
if(task_exists(id+TASK_HUD)) remove_task(id+TASK_HUD)
        if(
task_exists(id+TASK_REMOVE)) remove_task(id+TASK_REMOVE)
    }
}

public 
remove_headshot_mode(id)
{
    
id -= TASK_REMOVE

    has_item
[id] = false
    using_item
[id] = false

    
if(task_exists(id+TASK_HUD)) remove_task(id+TASK_HUD)

__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Abdelrhmanreda170
Junior Member
Join Date: Jun 2018
Old 03-06-2020 , 13:38   Re: OciXCrom's Custom Shop + API
Reply With Quote #253

Thanks man it works fine .
__________________
J17
Abdelrhmanreda170 is offline
denisdeathrun
Member
Join Date: Apr 2020
Old 04-16-2020 , 04:24   Re: OciXCrom's Custom Shop + API
Reply With Quote #254

Hi, I'm using your shop + knife menu and knife skills.
I've maked
PHP Code:
[yGravity Knife]
P_MODEL models/knife-mod/p_butcher.mdl
V_MODEL 
models/knife-mod/v_butcher.mdl
GRAVITY 
400 
And when I buy from the shop gravity and i change from knife to usp or usp to knife, my gravity dissapears.
Any help?

Last edited by denisdeathrun; 04-16-2020 at 04:27.
denisdeathrun is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 04-16-2020 , 08:18   Re: OciXCrom's Custom Shop + API
Reply With Quote #255

It's normal. I didn't make the gravity stack.
The shop applies the gravity only when you buy it.
The knife applies it every time select the knife in your hands and remove it when you change to another weapon.
You can probably fix this by changing the cvar "km_knife_only_skills" to 0.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Vuckooo
New Member
Join Date: Sep 2019
Old 05-15-2020 , 07:59   Re: OciXCrom's Custom Shop + API
Reply With Quote #256

I'm sorry to bother you, but I need a custom plugin custom shop, could someone add to it when I buy so I can buy respawn for points and the team chang option or swap also for points ... I really need it, please help me if you can guys ..
Vuckooo is offline
fum77
Junior Member
Join Date: May 2020
Location: Bournemouth (UK)
Old 07-13-2020 , 07:08   Re: OciXCrom's Custom Shop + API
Reply With Quote #257

I've tried the plugin and I like it a lot. This guy is the best ;) Thanks a lot brother!

Last edited by fum77; 07-13-2020 at 07:09.
fum77 is offline
Send a message via Skype™ to fum77
DON KHAN 1
Senior Member
Join Date: Mar 2019
Location: Pakistan
Old 07-23-2020 , 07:43   Re: OciXCrom's Custom Shop + API
Reply With Quote #258

hi
i am using ur custom shop but the custom shop is working but items are not showing.
[Custom Shop] The Custom shop doesn't have any available items at the moment.

i check amx_pausecfgmenu and Custom Shop & CSSHOP Items are working perfectly but i can't open menu idk why.
__________________
Facebook
My YouTube
Ro{Y}aL WarLanD CommuniTy
Selling Zombie CSO 4.3 Money System Mod
DON KHAN 1 is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 07-23-2020 , 08:08   Re: OciXCrom's Custom Shop + API
Reply With Quote #259

Did you add them in plugins.ini? If yes, remove them. They're already in plugins-cshop.ini. You probably added "cshop_items" before "custom_shop" - this won't work, the shop needs to be created before the items can be added in it.
__________________

Last edited by OciXCrom; 07-23-2020 at 08:08.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
DON KHAN 1
Senior Member
Join Date: Mar 2019
Location: Pakistan
Old 07-23-2020 , 08:42   Re: OciXCrom's Custom Shop + API
Reply With Quote #260

Thank You It Works.
__________________
Facebook
My YouTube
Ro{Y}aL WarLanD CommuniTy
Selling Zombie CSO 4.3 Money System Mod
DON KHAN 1 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 01:59.


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