Deathmatch Day Weapon pickup!
Ok, In my Jailbreak server, when a deathmatch is started users get a random weapon from const szWeapons which I have already specified.
PHP Code:
public do_specialday(id) { static CsTeams:team
if(g_iDayHasStarted) { return PLUGIN_HANDLED } if(g_iDay[ TOTAL_DAYS ] == DAY_DEATHMATCH) { iRandom = random( sizeof(szWeapons) ) SaveWeapons(iPlayer) give_item(iPlayer, szWeapons[iRandom]) cs_set_user_bpammo(iPlayer, iWeaponId[iRandom], iBpAmmo[iRandom]) } }
I need to stop users picking up other weapons other than the random weapon they received when its deathmatch day.
I have tried this but it stops me picking up any guns or items. I just want to not be able to pick up anything else put the random weapon.
PHP Code:
public Fwd_PlayerWeaponTouch( const iEntity, const id ) { if(!(1 <= id <= g_iMaxPlayers )) return HAM_IGNORED
new Model[32]; pev(iEntity, pev_model, Model, 31) static CsTeams:team team = cs_get_user_team(id)
switch( g_iDay[ TOTAL_DAYS ] ) { case DAY_DEATHMATCH: switch(team) { case CS_TEAM_T: if (!equal(Model, "iRandom")) return HAM_SUPERCEDE case CS_TEAM_CT: if (!equal(Model, "iRandom")) return HAM_SUPERCEDE } } }
Could someone help me?
|