Slight change to Gloves of Warmth
Posted: Sat Oct 14, 2006 6:38 am
Hiya guys
first off, much kudos for the WC3ft mod its the only reason i still love playing cs.
Just wondering if you could help me out, i have searched around and cant seem to find any information on what i'm trying to do so thought i would come here and ask for a little point in the right direction.
basically i have a plugin on my server that turns smoke nades into frost nades, and i ge really tired of people using the flaming gloves to spam orc nades etc. But instead want the gloves to give out a smoke (frost) nade.
I have got it to hand out a smoke grenade instead of the HE, but the problem i have is it doesnt seem to know that the user has a smoke grenade in his inventory and starts the countdown timer straight away.
Heres how it looks at the moment
thanks
first off, much kudos for the WC3ft mod its the only reason i still love playing cs.
Just wondering if you could help me out, i have searched around and cant seem to find any information on what i'm trying to do so thought i would come here and ask for a little point in the right direction.
basically i have a plugin on my server that turns smoke nades into frost nades, and i ge really tired of people using the flaming gloves to spam orc nades etc. But instead want the gloves to give out a smoke (frost) nade.
I have got it to hand out a smoke grenade instead of the HE, but the problem i have is it doesnt seem to know that the user has a smoke grenade in his inventory and starts the countdown timer straight away.
Heres how it looks at the moment
Code: Select all
public _Item_Glove(parm[2]){
#if ADVANCED_DEBUG
writeDebugInfo("_Item_Glove",parm[0])
#endif
if (!warcraft3)
return PLUGIN_CONTINUE
new id = parm[0]
// Stop calling this if the user is no longer connected
if(!p_data_b[id][PB_ISCONNECTED])
return PLUGIN_CONTINUE
// If the user buys another item, we should not be continuing this
if( p_data[id][P_ITEM2] != ITEM_GLOVES )
{
#if MOD == 0
set_hudmessage(0, 100, 0, 0.05, 0.65, 2, 0.02, 10.0, 0.01, 0.1, 2)
show_hudmessage(id,"")
#endif
#if MOD == 1
Create_HudText(id, "", 1)
#endif
return PLUGIN_CONTINUE
}
// If the user dies, they won't get a nade, display a message
if (!is_user_alive(id)){
#if MOD == 0
set_hudmessage(0, 100, 0, 0.05, 0.65, 2, 0.02, 10.0, 0.01, 0.1, 2)
show_hudmessage(id,"%L",id,"DONT_DIE_GOOSE")
#endif
#if MOD == 1
new message[128]
format(message, 127,"%L",id,"DONT_DIE_GOOSE")
Create_HudText(id, message, 1)
#endif
return PLUGIN_CONTINUE
}
// Give the nade or subtract 1 from the timer and call this again a second later
if(parm[1] < 1){
Item_Glove_Give(id)
}else{
#if MOD == 0
set_hudmessage(0, 100, 0, 0.05, 0.65, 2, 0.02, 10.0, 0.01, 0.1, 2)
show_hudmessage(id,"%L", id, "UNTIL_YOUR_NEXT_GRENADE", parm[1])
#endif
#if MOD == 1
new message[128]
format(message, 127,"%L", id, "UNTIL_YOUR_NEXT_GRENADE", parm[1])
Create_HudText(id, message, 1)
#endif
parm[1]--
set_task(1.0,"_Item_Glove",TASK_ITEM_GLOVES+id,parm,2)
}
return PLUGIN_CONTINUE
}
public Item_Glove_Give(id) {
#if ADVANCED_DEBUG
writeDebugInfo("Item_Glove_Give",id)
#endif
if (!warcraft3)
return PLUGIN_CONTINUE
if(!p_data_b[id][PB_ISCONNECTED])
return PLUGIN_CONTINUE
new wpnList[32] = 0
new number = 0
new foundNade = false
get_user_weapons(id,wpnList,number)
for (new i = 0;i < number && !foundNade;i++) {
#if MOD == 0
if (wpnList[i] == CSW_SMOKEGRENADE)
foundNade = true
#endif
#if MOD == 1
if (wpnList[i] == DODW_HANDGRENADE || wpnList[i] == DODW_STICKGRENADE)
foundNade = true
#endif
}
if (!foundNade && is_user_alive(id)){
#if MOD == 0
set_hudmessage(0, 100, 0, 0.05, 0.65, 2, 0.02, 10.0, 0.01, 0.1, 2)
show_hudmessage(id,"%L",id,"ENJOY_A_GRENADE")
give_item(id,"weapon_smokegrenade")
#endif
#if MOD == 1
new message[128]
format(message,127,"%L",id,"ENJOY_A_GRENADE")
Create_HudText(id, message, 1)
if(get_user_team(id)==ALLIES)
give_item(id,"weapon_handgrenade")
else
give_item(id,"weapon_stickgrenade")
#endif
}
p_data_b[id][PB_NADEJUSTRECEIVED]=false
return PLUGIN_CONTINUE
}