Code:
#include <amxmodx>
#include <amxmisc>
#include <fun>
new invifrags = 15 //set number of frags needed for invisibility
new weapfrags = 15 //set number of frags needed for weapon commands
public plugin_init()
{
register_plugin("VS Gameplay","0.1","ZiP*")
register_clcmd("say /ammo","weapon",ADMIN_USER,"all weapons")
register_clcmd("amx_invisible","invisible",ADMIN_USER,"invisibility")
register_clcmd("amx_visible","visible",ADMIN_USER,"visibility")
}
//WEAPON COMMANDS
// Id is the index of the player when a client uses a command
public weapon(id)
{
new kTeam = get_user_team(id)
// When the command is ran it checks if they are on team constant 1 and then checks if player frag
// is greater or equal to weapon frags. Both must be true to give weapon.
if(kTeam == 1 && (get_user_frags(id) >= weapfrags))
{
give_item(id,"weapon_vsstake") //Stake
give_item(id,"weapon_vsshotgun") // Shotgun
give_item(id,"weapon_vsshotgun")
give_item(id,"weapon_vsshotgun")
give_item(id,"weapon_vsshotgun")
give_item(id,"weapon_vsshotgun")
give_item(id,"weapon_vsshotgun")
give_item(id,"weapon_vsdbshotgun") //DBShotgun
give_item(id,"weapon_vsdbshotgun")
give_item(id,"weapon_vsdbshotgun")
give_item(id,"weapon_vsdbshotgun")
give_item(id,"weapon_vsdbshotgun")
give_item(id,"weapon_vsdbshotgun")
give_item(id,"weapon_vscolt") // Stake + Colt
give_item(id,"weapon_vsmp5") // MP5
give_item(id,"weapon_vsmp5")
give_item(id,"weapon_vsmp5")
give_item(id,"weapon_vsmp5")
give_item(id,"weapon_vsmp5")
give_item(id,"weapon_vsmp5")
give_item(id,"weapon_vscrossbow")
give_item(id,"weapon_vscrossbow")
give_item(id,"weapon_vscrossbow")
give_item(id,"weapon_vscrossbow")
give_item(id,"weapon_vscrossbow")
give_item(id,"weapon_vscrossbow")
give_item(id,"weapon_vscue") // Stake (cue)
give_item(id,"weapon_vsthunderfive") // Thunderfive
give_item(id,"weapon_vsthunderfive")
give_item(id,"weapon_vsthunderfive")
give_item(id,"weapon_vsthunderfive")
give_item(id,"weapon_vsthunderfive")
give_item(id,"weapon_vsthunderfive")
give_item(id,"weapon_vswinchester")
give_item(id,"weapon_vswinchester")
give_item(id,"weapon_vswinchester")
give_item(id,"weapon_vswinchester")
give_item(id,"weapon_vswinchester")
give_item(id,"weapon_vswinchester")
client_print(id, print_chat, "*You have been given ammo!")
} else {
client_print(id, print_chat, "*You need at least %i kills", weapfrags)
}
return PLUGIN_HANDLED
}
//INVISIBILITY
// Id is the index of the player that is use the command.
public invisible(id) {
// get the player team from the id.
new kTeam = get_user_team(id)
if(kTeam == 2 && (get_user_frags(id) >= invifrags))
{
set_task(0.0,"glowinvis",id)
set_task(2.5,"invis",id)
} else {
client_print(id, print_chat, "*You need at least %i kills", invifrags)
return PLUGIN_HANDLED
}
return PLUGIN_HANDLED
}
//VISIBILITY
public visible(id) {
new kTeam = get_user_team(id)
if(kTeam == 2 && (get_user_frags(id) >= invifrags))
{
glowinvis(id) // if you use a set task 0 secs you can also do this.
set_task(2.5,"vis",id)
return PLUGIN_HANDLED
} else {
client_print(id, print_chat, "*You need at least %i kills", invifrags)
return PLUGIN_HANDLED
}
return PLUGIN_HANDLED
}
//INVISIBILITY
public invis(id) {
set_user_rendering(id, kRenderFxPulseSlow,8,8,8,kRenderTransAlpha,0)
client_print(id, print_chat, "*You are Invisible!")
return PLUGIN_HANDLED
}
//VISIBILITY
public vis(id) {
set_user_rendering(id, kRenderFxPulseSlow,0,0,0,kRenderTransAlpha,255)
client_print(id, print_chat, "*You are Visible!")
return PLUGIN_HANDLED
}
//while getting invisible
public glowinvis(id) {
set_user_rendering(id,kRenderFxStrobeFast,255,130,19,kRenderNormal,25)
client_print(id, print_chat, "**Getting invisible!")
return PLUGIN_HANDLED
}
//while getting visible
public glowvis(id) {
set_user_rendering(id,kRenderFxPulseFast,200,19,130,kRenderNormal,25)
client_print(id, print_chat, "**Getting visible!")
return PLUGIN_HANDLED
}