Hi !
i want change score frag value (1 to 5 ) evry team T & CT
i try this do like that ... no thing ...who can give me correct code to do it ?
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>
new g_iTeam[33];
new MaxPlayers;
enum
{
CS_TEAM_T = 1,
CS_TEAM_CT = 2,
CS_TEAM_SPECTATOR = 3
};
public plugin_init() {
register_event("DeathMsg", "player_killed", "a")
MaxPlayers = get_maxplayers();
}
public player_killed()
{
new CTiGift = 5
new TiGift = 2
new iKiller = read_data(1)
new id = read_data(2)
new tid = get_user_team(iKiller)
switch(tid)
{
case 1: g_iTeam[iKiller] = CS_TEAM_T;
case 2: g_iTeam[iKiller] = CS_TEAM_CT;
default: return;
}
if(1 <= iKiller <= MaxPlayers)
{
if(get_user_team(id) == tid)
{
if(tid == CS_TEAM_T )
{
player_setScore(tid, TiGift)
}
if(tid == CS_TEAM_CT )
{
player_setScore(tid, CTiGift)
}
}
}
}
player_setScore(id, iAddFrags)
{
new iFrags = get_user_frags(id)
new iDeaths = get_user_deaths(id)
new tid = get_user_team(id)
if(iAddFrags != 0)
{
iFrags += iAddFrags
set_user_frags(id, iFrags)
}
message_begin(MSG_BROADCAST, get_user_msgid("TeamScore"))
write_byte(id)
write_short(iFrags)
write_short(iDeaths)
write_short(0)
write_short(tid)
message_end()
}
__________________