|
Senior Member
Join Date: Apr 2010
Location: Turkey
|

02-15-2013
, 04:56
[help] a few have problem
|
#1
|
PHP Code:
#include <amxmodx> #include <cstrike> #include <fun> #include <colorchat>
#define PLUGIN "[FUN]: Level Atlayinca Silah Degistir" #define VERSION "1.0" #define AUTHOR "eRdeneR"
new kills[33] = {0,...} new deaths[33] = {0,...} new kill[33][24]
#define LEVELS 4
new levels[4] = {1, 2, 3, 4}
new weapons[4][] = { "weapon_deagle", "weapon_p228", "weapon_elites", "weapon_fiveseven" }
new g_clip_size[31] = {-1, 52, -1, 90, 1, 32, 1, 100, 90, 1, 120, 100, 100, 90, 90, 90, 100, 120, 30, 120, 200, 32, 90, 120, 90, 2, 35, 90, 90, -1, 100}
new const AMMO[] = "items/9mmclip1.wav" new const LEVELUP[] = "deathrun/levelup.wav"
public plugin_precache() { precache_sound(AMMO); precache_sound(LEVELUP); } public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR); register_event("DeathMsg", "Event_Death", "a"); }
public client_connect(id) { kills[id] = 0; deaths[id] = 0; }
public client_disconnect(id) { kills[id] = 0; deaths[id] = 0; }
public Event_Death(id) { new killer = read_data(1); new victim = read_data(2); new weapon[24], vicname[32], killname[32] read_data(4,weapon,23) get_user_name(victim,vicname,31) get_user_name(killer,killname,31) ColorChat(0,NORMAL,"^4[Level -> Silah]:^1 ^3%s^1, ^4%s^1 tarafindan olduruldun...!",vicname,killname) client_cmd(id,"spk deathrun/levelup");
kills[killer] += 1; kills[victim] = 0; deaths[killer] = 0; deaths[victim] += 1;
for (new i = 0; i < LEVELS; i++) { if (kills[killer] == levels[i]) { announce(killer, i); return PLUGIN_CONTINUE; } } return PLUGIN_CONTINUE; }
announce(killer, level) { new wpn_index = get_user_weapon(killer)
if(g_clip_size[wpn_index] > -1) { new amount = cs_get_user_bpammo(killer, wpn_index)
if(amount < g_clip_size[wpn_index]) { amount += 10
if(amount > g_clip_size[wpn_index]) { amount = g_clip_size[wpn_index] } emit_sound(killer, CHAN_AUTO, AMMO, 1.0, ATTN_NORM, 0, PITCH_NORM) cs_set_user_bpammo(killer, wpn_index, amount) strip_user_weapons(killer) give_item(killer, weapons[level]); } }
}
1) Old weapons not strip. not work
PHP Code:
strip_user_weapons(killer)
2) not work
PHP Code:
cs_set_user_bpammo(killer, wpn_index, amount)
__________________
Last edited by Erdener; 02-15-2013 at 05:16.
|
|