Hello, I have some problem with my awp block. It gives me an awp with 3 ammo (as i want) but it gives me 30 bm ammo to and if you step on it again it reload your bp ammo to full. Want to know whats the problem.
EDIT: I also want to know how to change so only CT can have it instead of only T.
Here is the code:
PHP Code:
actionAwp(id, bool:OverrideTimer)
{
switch(cs_get_user_team(id))
{
case CS_TEAM_T:
{
//get game time
new Float:fTime = halflife_time();
//make sure player is alive
if (fTime >= gfAwpNextUse[id] || OverrideTimer)
{
give_item(id, "weapon_awp");
cs_set_weapon_ammo(find_ent_by_owner(1, "weapon_awp", id), 3);
cs_set_user_bpammo(1, CSW_AWP, 0);
//sets the time when the player can use the awp block again
gfAwpNextUse[id] = fTime + get_cvar_float("bm_awpcooldown");
//setup hud message
set_hudmessage(255, 255, 0, -1.0, 0.35, 0, 6.0, 10.0, 1.0, 1.0);
//Show Message
new szPlayerName[32];
get_user_name(id, szPlayerName, 32);
show_hudmessage(0, "%s got an Awp with 3 bullets!", szPlayerName);
}
else
{
set_hudmessage(gHudRed, gHudGreen, gHudBlue, gfTextX, gfTextY, gHudEffects, gfHudFxTime, gfHudHoldTime, gfHudFadeInTime, gfHudFadeOutTime, gHudChannel);
show_hudmessage(id, "Awp block next use: Next Round");
}
}
case CS_TEAM_CT:
{
set_hudmessage(gHudRed, gHudGreen, gHudBlue, gfTextX, gfTextY, gHudEffects, gfHudFxTime, gfHudHoldTime, gfHudFadeInTime, gfHudFadeOutTime, gHudChannel);
show_hudmessage(id, "You're a CT, you cant get an AWP!");
}
case CS_TEAM_SPECTATOR:
{
set_hudmessage(gHudRed, gHudGreen, gHudBlue, gfTextX, gfTextY, gHudEffects, gfHudFxTime, gfHudHoldTime, gfHudFadeInTime, gfHudFadeOutTime, gHudChannel);
show_hudmessage(id, "You're a Spectator, you cant get an AWP!");
}
}
}
I hope any1 could help me