well.. i downloaded the two scripts.. the one in the fisrt page(Rolnaaba) and the one in this page (k007).. both compile fine but when im in game it crashes my cs.
this is what it happens, everything works fine excepts when i have the $10.000.. then i bring the menu with /silvermenu and when i buy any gun it crashes my cs inmeditely.. dunno why.. the models are in the correct folder..
Anyway i edited the code to set the damage, so now it would make more damage and log kills.. take a look at the code.. it compiles fine but i can't test it becuase of that error.. and like i said, that error comes with all the plugins in this thread..
ummm i dunno why i can't upload the .sma file.. so i have to post the code here..
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>
#include <engine>
#include <fakemeta>
#define KeysSilverWeapons (1<<0)|(1<<1)|(1<<2)|(1<<3)
new CVAR_DAMAGE // damage multiplier cvar
public plugin_init()
{
//------------------------- damage multiplier stuff
CVAR_DAMAGE = register_cvar("amx_silverdamage", "2")
register_event( "Damage", "event_damage", "be" )
}
// event damage multiplier - i can't test it but it compiles fine
public event_damage( id ) {
new victim_id = id;
if( !is_user_connected( victim_id ) ) return PLUGIN_CONTINUE
new dmg_take = read_data( 2 );
new dmgtype = read_data( 3 );
new Float:multiplier = get_pcvar_float(CVAR_DAMAGE);
new Float:damage = dmg_take * multiplier;
new health = get_user_health( victim_id );
new iWeapID, attacker_id = get_user_attacker( victim_id, iWeapID );
if( !is_user_connected( attacker_id ) || !is_user_alive( victim_id ) ) {
return PLUGIN_HANDLED
}
if( iWeapID == CSW_AK47 && hasAK[id] == true ) {
if( floatround(damage) >= health ) {
if( victim_id == attacker_id ) {
return PLUGIN_CONTINUE
}else{
log_kill( attacker_id, victim_id, "ak47", 0 );
}
return PLUGIN_CONTINUE
}else {
if( victim_id == attacker_id ) return PLUGIN_CONTINUE
fakedamage( victim_id, "weapon_ak47", damage, dmgtype );
}
}
else if( iWeapID == CSW_M4A1 && hasM4[id] == true ) {
if( floatround(damage) >= health ) {
if( victim_id == attacker_id ) {
return PLUGIN_CONTINUE
}else{
log_kill( attacker_id, victim_id, "m4a1", 0 );
}
return PLUGIN_CONTINUE
}else {
if( victim_id == attacker_id ) return PLUGIN_CONTINUE
fakedamage( victim_id, "weapon_m4a1", damage, dmgtype );
}
}
else if( iWeapID == CSW_MP5NAVY && hasMP[id] == true ) {
if( floatround(damage) >= health ) {
if( victim_id == attacker_id ) {
return PLUGIN_CONTINUE
}else{
log_kill( attacker_id, victim_id, "mp5navy", 0 );
}
return PLUGIN_CONTINUE
}else {
if( victim_id == attacker_id ) return PLUGIN_CONTINUE
fakedamage( victim_id, "weapon_mp5navy", damage, dmgtype );
}
}
return PLUGIN_CONTINUE
}
// log kills for damage multiplier
stock log_kill(killer, victim, weapon[],headshot) {
user_silentkill( victim );
message_begin( MSG_ALL, get_user_msgid( "DeathMsg" ), {0,0,0}, 0 );
write_byte( killer );
write_byte( victim );
write_byte( headshot );
write_string( weapon );
message_end();
new kfrags = get_user_frags( killer );
set_user_frags( killer, kfrags++ );
new vfrags = get_user_frags( victim );
set_user_frags( victim, vfrags++ );
return PLUGIN_CONTINUE
}
then you have to delete the lines with // in ak, m4, and mp5 funcbuy
PHP Code:
//*****{BUY AK}*****
public funcbuyak(id)
{
if(get_pcvar_num(cvar_enabled) == 0)
{
client_print(id,print_chat,"Silver Weapons Mod is disabled, sorry")
return PLUGIN_HANDLED
}
else
{
new money = cs_get_user_money(id)
new price = get_pcvar_num(cvar_ak_cost)
if(!is_user_alive(id))
{
client_print(id, print_chat, "You can only buy Silver Weapons when alive")
}
else if(hasAK[id])
{
client_print(id, print_chat, "You already have a silver AK")
}
else if(money < price)
{
client_print(id, print_chat, "You can't afford that, DUH!!")
}
else
{
//new ammo, clip
//new damage
//damage = read_data(2)
hasAK[id] = true
strip_user_weapons(id)
cs_set_user_money(id, money - price)
give_item(id,"weapon_ak47")
cs_set_user_bpammo(id, CSW_AK47, 90)
client_print(id,print_chat,"You have bought the Silver AK for %i doallars",price)
/*if(get_user_weapon(id,ammo,clip) == CSW_AK47 && hasAK[id] == true)
{
damage = damage*4/3
}*/
}
}
return PLUGIN_HANDLED
}
__________________