New vs static for deathmsg
New vs static for deathmsg
What's better for deathmsg?
PHP Code:
public plugin_init() {
register_event("DeathMsg", "halal", "a")
}
public halal() {
static killer, victim, headshot, weapon[32];
killer = read_data(1);
victim = read_data(2);
headshot = read_data(3);
read_data(4, weapon, charsmax(weapon));
if (!is_user_connected(killer) || !is_user_connected(victim) || killer == victim || get_user_team(killer) == get_user_team(victim)) return;
if(killer != victim && headshot) {
if (containi(weapon, "awp")) player_data[killer][AWP_KILLS] += HEADSHOT_POINT;
else if (containi(weapon, "scout")) player_data[killer][SCOUT_KILLS] += HEADSHOT_POINT;
else if (containi(weapon, "deagle")) player_data[killer][DEAGLE_KILLS] += HEADSHOT_POINT;
else if (containi(weapon, "usp")) player_data[killer][USP_KILLS] += HEADSHOT_POINT;
else if (containi(weapon, "glock")) player_data[killer][GLOCK_KILLS] += HEADSHOT_POINT;
else if (containi(weapon, "knife")) player_data[killer][KNIFE_KILLS] += HEADSHOT_POINT;
set_hudmessage(0, 255, 0, -0.9, 0.15, 0, 6.0, 1.0);
show_hudmessage(killer, "+%i Pont", HEADSHOT_POINT);
}
else if(killer != victim) {
if (containi(weapon, "awp")) player_data[killer][AWP_KILLS] += KILL_POINT;
else if (containi(weapon, "scout")) player_data[killer][SCOUT_KILLS] += KILL_POINT;
else if (containi(weapon, "deagle")) player_data[killer][DEAGLE_KILLS] += KILL_POINT;
else if (containi(weapon, "usp")) player_data[killer][USP_KILLS] += KILL_POINT;
else if (containi(weapon, "glock")) player_data[killer][GLOCK_KILLS] += KILL_POINT;
else if (containi(weapon, "knife")) player_data[killer][KNIFE_KILLS] += KILL_POINT;
set_hudmessage(0, 255, 0, -0.9, 0.15, 0, 6.0, 1.0);
show_hudmessage(killer, "+%i Pont", KILL_POINT);
}
}
|