enum // Equip Modes
{
EQUIP_AWP,
EQUIP_AIM_AK_COLT,
EQUIP_AIM_DUST,
EQUIP_COSTOM
}
new g_iEquipType
public plugin_init()
{
new szMapName[32]; get_mapname(szMapName, charsmax(szMapName))
switch(szMapName[0])
{
case 'a':
{
if(equali(szMapName, "awp_", 4)) // all awp_ maps equip us with awp. One pattern -> one equip type
g_iEquipType = EQUIP_AWP
else if(equali(szMapName, "aim_ak_colt")) // aim maps with autoequip can have veriety of guns
g_iEquipType = EQUIP_AIM_AK_COLT
else if(equali(szMapName, "aim_dust"))
g_iEquipType = EQUIP_AIM_DUST
}
case 'c', 'd': return // cs_, de_ maps. we stop here and do not register forwards (playerspawn and/or onspawnequip(reapi), etc).
//case '#': {} // any other cases...
}
// Here we register our forwards
}
public PlayerSpawn(id) // Ham or Reapi (onspawnequip?)
{
// here we strip all weapons from our player
// alt. method is to block default equip by RG_CBasePlayer_OnSpawnEquip.
switch(g_iEquipType)
{
case EQUIP_AWP:
{
// here we equip player with awp, knife
}
case EQUIP_AIM_AK_COLT:
{
// ak/colt (2 guns? or guns based on player team?)
}
case EQUIP_COSTOM:
{
// Your custom equip. All you need is to change g_iEquipType to EQUIP_COSTOM, end, when needed, change g_iEquipType back
}
}
}