| shuttle_wave |
07-05-2010 05:11 |
Function Repeated
When g_bRebel is true that means they are rebel. but for some reason even when its true and player has been killed its suppose to show
client_printc(0, "%s !tGuard %s Killed Prisoner !t%s !g( Rebel )", PREFIX, szKName, szVName);
but for some reason it just goes to the unarmed one when they are a rebel. I just seems to skip if(g_bRebel[iVictim])
{
and go to !IsArmed. even when i put !IsArmed && !g_bRebel[iVictim]
wats the problem can someone help
PHP Code:
// Death Message public Event_DeathMsg() { new iVictim = read_data(2); new iKiller = read_data(1); if(IsPlayer(iKiller) && cs_get_user_team(iVictim) == CS_TEAM_T && Game != LR_NADE && cs_get_user_team(iKiller) == CS_TEAM_CT && !g_bLROneProgress && !g_bLRInProgress[iKiller]) { if(g_bRebel[iVictim]) { new szVName[32]; new szKName[32]; get_user_name(iVictim, szVName, charsmax(szVName)); get_user_name(iKiller, szKName, charsmax(szKName)); client_printc(0, "%s !tGuard %s Killed Prisoner !t%s !g( Rebel )", PREFIX, szKName, szVName); Shop_XP[iKiller] += get_pcvar_num(p_KillRebelXP); client_printc(iKiller, "%s You have recieved !g%iXP!n for killing a Rebel", PREFIX, get_pcvar_num(p_KillRebelXP)); } else if(IsArmed(iVictim)) { new szVName[32], szKName[32]; get_user_name(iVictim, szVName, charsmax(szVName)); get_user_name(iKiller, szKName, charsmax(szKName)); client_printc(0, "%s !tGuard %s Killed Prisoner !t%s !g( Armed Prisoner )", PREFIX, szKName, szVName); Shop_XP[iKiller] += get_pcvar_num(p_KillArmedPXP); client_printc(iKiller, "%s You have recieved !g%iXP!n for killing a Armed Prisoner", PREFIX, get_pcvar_num(p_KillArmedPXP)); } else if(!IsArmed(iVictim)) { new szVName[32], szKName[32]; get_user_name(iVictim, szVName, charsmax(szVName)); get_user_name(iKiller, szKName, charsmax(szKName)); client_printc(0, "%s !tGuard %s Killed Prisoner !t%s !g( Unarmed Prisoner )", PREFIX, szKName, szVName); } } else if(g_bLRInProgress[iVictim] && iKiller != iVictim) { switch(Game) { case LR_KNIFE: { new szKName[32]; get_user_name(iKiller, szKName, 31); new szVName[32]; get_user_name(iVictim, szVName, 31); client_printc(0, "%s !g%s!n has won !tKnife Fight!n against !g%s!n", PREFIX, szKName, szVName); g_bLRInProgress[iVictim] = false; g_bLRInProgress[iKiller] = false; g_bBeacon[iVictim] = false; g_bBeacon[iKiller] = false; g_bLRCountDownProgress = false; remove_task(TASK_COUNTDOWN); remove_task(TASK_BOMB); remove_task(TASK_HIDDEN); remove_task(TASK_CRAZY); strip_user_weapons(iKiller); give_item(iKiller, "weapon_knife"); set_user_health(iKiller, 100); } case LR_SHOT: { new szKName[32]; get_user_name(iKiller, szKName, 31); new szVName[32]; get_user_name(iVictim, szVName, 31); client_printc(0, "%s !g%s!n has won !tShot 4 Shot!n against !g%s!n", PREFIX, szKName, szVName); g_bLRInProgress[iVictim] = false; g_bLRInProgress[iKiller] = false; g_bBeacon[iVictim] = false; g_bBeacon[iKiller] = false; g_bLRCountDownProgress = false; remove_task(TASK_COUNTDOWN); remove_task(TASK_BOMB); remove_task(TASK_HIDDEN); remove_task(TASK_CRAZY); strip_user_weapons(iKiller); give_item(iKiller, "weapon_knife"); set_user_health(iKiller, 100); } case LR_NADE: { new szKName[32]; get_user_name(iKiller, szKName, 31); new szVName[32]; get_user_name(iVictim, szVName, 31); client_printc(0, "%s !g%s!n has won !tGrenade Battle!n against !g%s!n", PREFIX, szKName, szVName); g_bLRInProgress[iVictim] = false; g_bLRInProgress[iKiller] = false; g_bBeacon[iVictim] = false; g_bBeacon[iKiller] = false; g_bLRCountDownProgress = false; remove_task(TASK_COUNTDOWN); remove_task(TASK_BOMB); remove_task(TASK_HIDDEN); remove_task(TASK_CRAZY); strip_user_weapons(iKiller); give_item(iKiller, "weapon_knife"); set_user_health(iKiller, 100); } case LR_FRENZY: { new szKName[32]; get_user_name(iKiller, szKName, 31); new szVName[32]; get_user_name(iVictim, szVName, 31); client_printc(0, "%s !g%s!n has won !tShooting Frenzy!n against !g%s!n", PREFIX, szKName, szVName); g_bLRInProgress[iVictim] = false; g_bLRInProgress[iKiller] = false; g_bBeacon[iVictim] = false; g_bBeacon[iKiller] = false; g_bLRCountDownProgress = false; remove_task(TASK_COUNTDOWN); remove_task(TASK_BOMB); remove_task(TASK_HIDDEN); remove_task(TASK_CRAZY); strip_user_weapons(iKiller); give_item(iKiller, "weapon_knife"); set_user_health(iKiller, 100); } case LR_SHOTTY: { new szKName[32]; get_user_name(iKiller, szKName, 31); new szVName[32]; get_user_name(iVictim, szVName, 31); client_printc(0, "%s !g%s!n has won !tShotty Madness!n against !g%s!n", PREFIX, szKName, szVName); g_bLRInProgress[iVictim] = false; g_bLRInProgress[iKiller] = false; g_bBeacon[iVictim] = false; g_bBeacon[iKiller] = false; g_bLRCountDownProgress = false; remove_task(TASK_COUNTDOWN); remove_task(TASK_BOMB); remove_task(TASK_HIDDEN); remove_task(TASK_CRAZY); strip_user_weapons(iKiller); give_item(iKiller, "weapon_knife"); set_user_health(iKiller, 100); } case LR_SCOUT: { new szKName[32]; get_user_name(iKiller, szKName, 31); new szVName[32]; get_user_name(iVictim, szVName, 31); client_printc(0, "%s !g%s!n has won !tScoutz Supprise!n against !g%s!n", PREFIX, szKName, szVName); g_bLRInProgress[iVictim] = false; g_bLRInProgress[iKiller] = false; g_bBeacon[iVictim] = false; g_bBeacon[iKiller] = false; g_bLRCountDownProgress = false; remove_task(TASK_COUNTDOWN); remove_task(TASK_BOMB); remove_task(TASK_HIDDEN); remove_task(TASK_CRAZY); strip_user_weapons(iKiller); give_item(iKiller, "weapon_knife"); set_user_health(iKiller, 100); } } } if(cs_get_user_team(iVictim) == CS_TEAM_CT) { if(IsPlayer(iKiller) && cs_get_user_team(iKiller) == CS_TEAM_T && !g_bLRInProgress[iVictim] && !g_bLRInProgress[iKiller]) { Shop_XP[iKiller] += get_pcvar_num(p_KillGuardXP); client_printc(iKiller, "%s You have recieved !g%iXP!n for killing a Guard", PREFIX, get_pcvar_num(p_KillGuardXP)); } } return PLUGIN_HANDLED; }
// Damage public fwdHamTakeDamage(iVictim, iAttacker, Float:iDmg) { if(!(1 <= iAttacker <= g_iMaxPlayers)) return HAM_IGNORED; if( ( g_bLRInProgress[iVictim] && g_bLRInProgress[iAttacker] ) || ( iAttacker == iVictim ) ) return HAM_IGNORED; else if(g_bLRInProgress[iVictim] && !g_bLRInProgress[iAttacker]) { new AttHealth = get_user_health(iAttacker); if( (AttHealth - iDmg) <= 0) { user_kill(iAttacker); // Say why he was killed client_printc(iVictim, "%s You were killed for attacking a player in !gLast Request!n", PREFIX); }
else { set_user_health(iAttacker, floatround(AttHealth - iDmg)); } return HAM_SUPERCEDE; }
else if(g_bLRInProgress[iAttacker] && !g_bLRInProgress[iVictim]) { if( Game == LR_FRENZY || Game == LR_NADE || Game == LR_SHOTTY ) return HAM_SUPERCEDE; // Get attacker's health new AttHealth = get_user_health(iAttacker); if( (AttHealth - iDmg) <= 0 ) { user_kill(iAttacker); client_printc(iVictim, "%s You were killed for attacking a player not in !gLast Request!n", PREFIX); } else { set_user_health(iAttacker, floatround(AttHealth - iDmg)); } return HAM_SUPERCEDE; } if(cs_get_user_team(iVictim) == CS_TEAM_CT && cs_get_user_team(iAttacker) == CS_TEAM_T && !g_bLROneProgress) { if(get_pcvar_num(p_Rebel)) { if(!g_bRebel[iAttacker]) { // Make him a rebel Set_Player_Rebel(iAttacker); } } } return HAM_IGNORED; }
public damage_event(iVictim) { new iAttacker = get_user_attacker(iVictim); if(get_pcvar_num(p_FreeKillDetection)) { if(IsPlayer(iAttacker) && !g_bLROneProgress && g_bRebel[iVictim] && cs_get_user_team(iVictim) == CS_TEAM_T && !g_bLRInProgress[iVictim] && g_bAlive[iVictim] && cs_get_user_team(iAttacker) == CS_TEAM_CT) { if( read_data(4) || read_data(5) || read_data(6) && g_bAlive[iVictim] && g_bAlive[iAttacker]) { new szAName[32]; new szVName[32]; get_user_name(iAttacker, szAName, 31); get_user_name(iVictim, szVName, 31); client_printc(0, "%s !g%s!n Has Attacked !g%s!n !t( Rebel )!n", PREFIX, szAName, szVName); } } else if(IsPlayer(iAttacker) && !g_bRebel[iVictim] && !g_bLROneProgress && cs_get_user_team(iVictim) == CS_TEAM_T && !g_bLRInProgress[iVictim] && g_bAlive[iVictim] && cs_get_user_team(iAttacker) == CS_TEAM_CT && !IsArmed(iVictim)) { if( read_data(4) || read_data(5) || read_data(6) && g_bAlive[iVictim] && g_bAlive[iAttacker]) { new szAName[32]; new szVName[32]; get_user_name(iAttacker, szAName, 31); get_user_name(iVictim, szVName, 31); client_printc(0, "%s !g%s!n Has Attacked !g%s!n !t( Unarmed Prisoner )!n", PREFIX, szAName, szVName); } } else if(IsPlayer(iAttacker) && !g_bLROneProgress && !g_bRebel[iVictim] && cs_get_user_team(iVictim) == CS_TEAM_T && !g_bLRInProgress[iVictim] && g_bAlive[iVictim] && cs_get_user_team(iAttacker) == CS_TEAM_CT && IsArmed(iVictim)) { if( read_data(4) || read_data(5) || read_data(6) && g_bAlive[iVictim] && g_bAlive[iAttacker]) { new szAName[32]; new szVName[32]; get_user_name(iAttacker, szAName, 31); get_user_name(iVictim, szVName, 31); client_printc(0, "%s !g%s!n Has Attacked !g%s!n !t( Armed Prisoner )!n", PREFIX, szAName, szVName); } } } return PLUGIN_HANDLED; }
|