Forumas skirtas spręsti problemas iškilusias su CS 1.6 serveriais.
luxuks
Jau po truputį tampa savu
Posts: 186 Joined: 2014 Jun 18 17:20
Skype: lukas.luxuks
Post
by luxuks » 2017 Jan 03 14:50
Sveiki, cia per plugina viena bandau pasidaryt kad vipai gautu dvigubai daugiau xp. Cia po apacia yra kodas kaip as pasidares esu kad vipai gautu 2x xp pagal cvara. Viska compilina be errroru bet serveryje neveikia cvarai su galune _vip, jie yra sukurti viska bet cia turbut eilutej sitame kode netaip kazka suvedu kad pluginas vistiek veikia tik pagal senaji cvara. Zodziu jeigu nesupratot ko noriu tai as noriu kad sitame koduke vipai su b flagu (reservation) gautu xp pagal kita cvara siuo atveju pagal tus 3 cvarus su _vip galunem. Buciau labai dekingas uz pagalba.
Code: Select all
public EventDeathMsg(){ new killer = read_data(1); new victim = read_data(2); if( (g_first_client <= killer <= g_max_clients) && victim != killer ) { if( IsUserAuthorized(killer) ) { // regular kill new xp = get_pcvar_num(cvar_xp_kill); if(get_user_flags(read_data(1) & ADMIN_RESERVATION)) { get_pcvar_num(cvar_xp_kill_vip); } if( read_data(3) ) { // headshot kill xp += get_pcvar_num(cvar_xp_headshot); if(get_user_flags(read_data(3) & ADMIN_RESERVATION)) { xp += get_pcvar_num(cvar_xp_headshot_vip); } } else { static weapon[20]; read_data(4, weapon, sizeof(weapon) - 1); if( contain(weapon, "grenade") >= 0 ) { // grenade kill (or frostnade) xp += get_pcvar_num(cvar_xp_grenade); if(get_user_flags(read_data(4) & ADMIN_RESERVATION)) { xp += get_pcvar_num(cvar_xp_grenade_vip); } } } g_xp[killer] += xp; Print(killer, "Gavai %i XP!", xp); Save(killer); } } else if( IsUserAuthorized(victim) ) { // victim died of map causes or killed self new xp = get_pcvar_num(cvar_xp_suicide); g_xp[victim] -= xp; Print(victim, "Praradai %i XP!", xp); Save(victim); }}
-- 2017 Sau 03 15:51 --
Kur cia problema kad neduoda vipam to kito cvaro?
Last edited by
luxuks on 2017 Jan 03 14:52, edited 1 time in total.
GoogleBot
Ar galit patikėti? Jis jau parašė 20 žinučių
Posts: 24 Joined: 2016 Nov 13 00:04
Skype: kasys123
Post
by GoogleBot » 2017 Jan 03 15:35
ten kur pakomentuota //regular kill tikriausiai turejai rasyt
if(get_user_flags(read_data(1) & ADMIN_RESERVATION))
{
xp = get_pcvar_num(cvar_xp_kill_vip);
}
vietoj
if(get_user_flags(read_data(1) & ADMIN_RESERVATION))
{
get_pcvar_num(cvar_xp_kill_vip);
}
Last edited by
GoogleBot on 2017 Jan 03 17:55, edited 1 time in total.
luxuks
Jau po truputį tampa savu
Posts: 186 Joined: 2014 Jun 18 17:20
Skype: lukas.luxuks
Post
by luxuks » 2017 Jan 03 17:36
Neduoda dvigubai daugiau xp vistiek nors cvare nurodyta kad vietoj 1xp duotu 2xp. Cia turbut reikia kazkaip kitaip tas eilutes rasyt sitoj vietoj
ArtHa123
Flooderis arba specialistas
Posts: 738 Joined: 2014 Feb 19 18:40
Post
by ArtHa123 » 2017 Jan 03 18:45
Na kaip matau turbūt nelabai pagavai
read_data
esmę, jeigu -->
if(get_user_flags(read_data(4) & ADMIN_RESERVATION))
Code: Select all
public EventDeathMsg(){ new killer = read_data(1); new victim = read_data(2); if( (g_first_client <= killer <= g_max_clients) && victim != killer ) { if( IsUserAuthorized(killer) ) { // regular kill new xp = get_pcvar_num(cvar_xp_kill); if(get_user_flags(killer & ADMIN_RESERVATION)) { xp = get_pcvar_num(cvar_xp_kill_vip); } if( read_data(3) ) { // headshot kill xp += get_pcvar_num(cvar_xp_headshot); if(get_user_flags(killer & ADMIN_RESERVATION)) { xp += get_pcvar_num(cvar_xp_headshot_vip); } } else { static weapon[20]; read_data(4, weapon, sizeof(weapon) - 1); if( contain(weapon, "grenade") >= 0 ) { // grenade kill (or frostnade) xp += get_pcvar_num(cvar_xp_grenade); if(get_user_flags(killer & ADMIN_RESERVATION)) { xp += get_pcvar_num(cvar_xp_grenade_vip); } } } g_xp[killer] += xp; Print(killer, "Gavai %i XP!", xp); Save(killer); } } else if( IsUserAuthorized(victim) ) { // victim died of map causes or killed self new xp = get_pcvar_num(cvar_xp_suicide); g_xp[victim] -= xp; Print(victim, "Praradai %i XP!", xp); Save(victim); }}
Bandyk.
P.s. kiek aš žinau
Code: Select all
read_data(1) - "index_of_killer"read_data(2) - "index_of_victim"read_data(3) - "headshot"read_data(4) - "weapon_name"
Last edited by
ArtHa123 on 2017 Jan 03 18:47, edited 1 time in total.
Users browsing this forum: No registered users and 4 guests