Raised This Month: $32 Target: $400
 8% 

help: vip plugin problem with secound pistol


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
numbster
Member
Join Date: Dec 2016
Old 02-06-2018 , 10:50   help: vip plugin problem with secound pistol
Reply With Quote #1

When you are respawn you are with 2 pistol. I wanna only Deagle Eagle. Can't fix it myself


Code:
#include <amxmodx>
#include <cstrike>
#include <fun>
#include <hamsandwich>

#define PLUGIN_VERSION "1.0"
#define VIP_FLAG "b"
#define VIP_HEALTH 105
#define VIP_ARMOR 105

new const g_szItems[][] = 
{
    "weapon_deagle",
    "item_assaultsuit",
    "weapon_hegrenade",
    "weapon_flashbang",
    "weapon_flashbang"
}

new g_iFlag,
    g_iSize

public plugin_init()
{
    register_plugin("VIP Extras #3", PLUGIN_VERSION, "iPlay.bg (OciXCrom)")
    RegisterHam(Ham_Spawn, "player", "OnPlayerSpawn", 1)
    g_iFlag = read_flags(VIP_FLAG)
    g_iSize = sizeof(g_szItems)
}

public OnPlayerSpawn(id)
{
    if(!is_user_alive(id) || (!(get_user_flags(id) & g_iFlag)))
        return
        
    for(new i; i < g_iSize; i++)
        give_item(id, g_szItems[i])
    
    cs_set_user_bpammo(id, CSW_DEAGLE, 35)
    set_user_health(id, VIP_HEALTH)
    set_user_armor(id, VIP_ARMOR)
}

Last edited by numbster; 02-26-2018 at 16:34. Reason: solved
numbster is offline
Nutu_
AlliedModders Donor
Join Date: Mar 2016
Location: Germany
Old 02-06-2018 , 16:45   Re: help: vip plugin problem with secound pistol
Reply With Quote #2

do you have another vip plugin on your server? that gives you guns/pistols? cuz from that plugin, you get only one deagle in what I could see, nvm, what pistols do you get? deagle and?
__________________
a simple act of caring creates an endless ripple.
Nutu_ is offline
numbster
Member
Join Date: Dec 2016
Old 02-06-2018 , 17:05   Re: help: vip plugin problem with secound pistol
Reply With Quote #3

if you are counter-terrorist USP and like terrorist Glock . Plus armor, he and flashbang but this is good. The problem is two pistols.

Last edited by numbster; 02-06-2018 at 17:05.
numbster is offline
ish12321
Veteran Member
Join Date: May 2016
Old 02-07-2018 , 01:58   Re: help: vip plugin problem with secound pistol
Reply With Quote #4

Strip weapons before giving new !!
__________________
['O|s|G'] | Death Wins a.k.a Ish Chhabra was here
ish12321 is offline
numbster
Member
Join Date: Dec 2016
Old 02-07-2018 , 08:23   Re: help: vip plugin problem with secound pistol
Reply With Quote #5

how?

edit: you wanna put another plugin to work this one fine? this is little stupid.

Last edited by numbster; 02-07-2018 at 08:51.
numbster is offline
D3XT3R
AlliedModders Donor
Join Date: Nov 2016
Location: Lithuania, Bomb A (Kauna
Old 02-07-2018 , 13:20   Re: help: vip plugin problem with secound pistol
Reply With Quote #6

try this:

Code:
#include <amxmodx> #include <cstrike> #include <fun> #include <hamsandwich> #define PLUGIN_VERSION "1.0" #define VIP_FLAG "b" #define VIP_HEALTH 105 #define VIP_ARMOR 105 const PRIMARY_WEAPONS_BIT_SUM = (1<<CSW_SCOUT)|(1<<CSW_XM1014)|(1<<CSW_MAC10)|(1<<CSW_AUG)|(1<<CSW_UMP45)|(1<<CSW_SG550)|(1<<CSW_GALIL)|(1<<CSW_FAMAS)|(1<<CSW_AWP)|(1<<CSW_MP5NAVY)|(1<<CSW_M249)|(1<<CSW_M3)|(1<<CSW_M4A1)|(1<<CSW_TMP)|(1<<CSW_G3SG1)|(1<<CSW_SG552)|(1<<CSW_AK47)|(1<<CSW_P90) const SECONDARY_WEAPONS_BIT_SUM = (1<<CSW_P228)|(1<<CSW_ELITE)|(1<<CSW_FIVESEVEN)|(1<<CSW_USP)|(1<<CSW_GLOCK18)|(1<<CSW_DEAGLE) new const g_szItems[][] = {     "weapon_deagle",     "item_assaultsuit",     "weapon_hegrenade",     "weapon_flashbang",     "weapon_flashbang" } new g_iFlag,     g_iSize public plugin_init() {     register_plugin("VIP Extras #3", PLUGIN_VERSION, "iPlay.bg (OciXCrom)")     RegisterHam(Ham_Spawn, "player", "OnPlayerSpawn", 1)     g_iFlag = read_flags(VIP_FLAG)     g_iSize = sizeof(g_szItems) } public OnPlayerSpawn(id) {     if(!is_user_alive(id) || (!(get_user_flags(id) & g_iFlag)))         return             for(new i; i < g_iSize; i++)         give_item(id, g_szItems[i])     drop_weapons(id, 1)     cs_set_user_bpammo(id, CSW_DEAGLE, 35)     set_user_health(id, VIP_HEALTH)     set_user_armor(id, VIP_ARMOR) } // Drop primary/secondary weapons stock drop_weapons(id, dropwhat) {     // Get user weapons     static weapons[32], num, i, weaponid     num = 0 // reset passed weapons count (bugfix)     get_user_weapons(id, weapons, num)         // Loop through them and drop primaries or secondaries     for (i = 0; i < num; i++)     {         // Prevent re-indexing the array         weaponid = weapons[i]                 if ((dropwhat == 1 && ((1<<weaponid) & PRIMARY_WEAPONS_BIT_SUM)) || (dropwhat == 2 && ((1<<weaponid) & SECONDARY_WEAPONS_BIT_SUM)))         {             // Get weapon entity             static wname[32]; get_weaponname(weaponid, wname, charsmax(wname))             engclient_cmd(id, "drop", wname)         }     } } /* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE *{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1049\\ f0\\ fs16 \n\\ par } */
__________________

Last edited by D3XT3R; 02-07-2018 at 14:06.
D3XT3R is offline
Send a message via Skype™ to D3XT3R
numbster
Member
Join Date: Dec 2016
Old 02-07-2018 , 13:33   Re: help: vip plugin problem with secound pistol
Reply With Quote #7

error 017: undefined symbol "PRIMARY_WEAPONS_BIT_SUM"

can't compiled
numbster is offline
D3XT3R
AlliedModders Donor
Join Date: Nov 2016
Location: Lithuania, Bomb A (Kauna
Old 02-07-2018 , 14:06   Re: help: vip plugin problem with secound pistol
Reply With Quote #8

code fixet try it again
__________________
D3XT3R is offline
Send a message via Skype™ to D3XT3R
numbster
Member
Join Date: Dec 2016
Old 02-07-2018 , 18:30   Re: help: vip plugin problem with secound pistol
Reply With Quote #9

still two pistols
numbster is offline
ish12321
Veteran Member
Join Date: May 2016
Old 02-07-2018 , 23:53   Re: help: vip plugin problem with secound pistol
Reply With Quote #10

Another good solution is ReAPI !
__________________
['O|s|G'] | Death Wins a.k.a Ish Chhabra was here
ish12321 is offline
Reply


Thread Tools
Display Modes

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 07:29.


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