Raised This Month: $ Target: $400
 0% 

[Help] Fix my Codes


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Zombie Lurker
Senior Member
Join Date: Mar 2009
Old 05-25-2009 , 09:19   [Help] Fix my Codes
Reply With Quote #1

[Help] Edit my Codes

Hi everyone. I have some codes I made earlier on but I need help with it. It doesnt work properly. I'll put a list of the problems I currently know.

List :
1. The menu doesnt work.
2. The weapon model isnt changed.
3. Sometimes you get the weapon out of nowhere.(Rare)
4. The clip ammo for the M249 below doesnt work as well. (I mean after reload)
Thats about all I know now.

Can anyone help me edit the codes to work? Here it is :
PHP Code:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <engine>
#include <fakemeta>
#include <fun>
#include <cstrike>
#include <hamsandwich>
#define PLUGIN "CSO Weapon Menu"
#define VERSION "1.0"
#define AUTHOR "Zombie Lurker"
#define CSO_MENUKEYS (1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<4)|(1<<5)|(1<<6)|(1<<7)|(1<<8)|(1<<9)
new bool:hasmg3m[32], hasm1887[32], hasxm8[32], hasddeagle[32], hasstrong_knife[32]
new 
CSOmenug_iMaxPlayersg_curWpn[33][2];
new const 
model_mg3m_view[] = "models/zombie_plague/v_mg3m.mdl"
new const model_m1887_view[] = "models/zombie_plague/v_m1887.mdl"
new const model_xm8_view[] = "models/zombie_plague/v_xm8.mdl"
new const model_ddeagle_view[] = "models/zombie_plague/v_ddeagle.mdl"
new const model_strong_knife_view[] = "models/zombie_plague/v_strong_knife.mdl"
public plugin_init() {
register_plugin(PLUGINVERSIONAUTHOR)
 
register_cvar("mg3m_cost""10000")
register_cvar("m1887_cost""10000")
register_cvar("xm8_cost""8000")
register_cvar("ddeagle_cost""5000")
register_cvar("strong_knife_cost""5000")
g_iMaxPlayers get_maxplayers()
 
register_event("Damage" "event_Damage" "b" "2>0");
RegisterHamHam_TakeDamage"player""Player_TakeDamage" );
 
register_clcmd("say""handle_say")
register_clcmd("say_team""handle_say")
 
CSOmenu menu_create("CSO Weapon Menu""do_CSOmenu")
menu_additem(CSOmenu"Buy MG3M Cost : $10000""1"ADMIN_ALL)
menu_additem(CSOmenu"Buy M1887 Cost : $10000""2"ADMIN_ALL)
menu_additem(CSOmenu"Buy XM8 Cost : $8000""3"ADMIN_ALL)
menu_additem(CSOmenu"Buy Dual Deagles Cost : $5000""4"ADMIN_ALL)
menu_additem(CSOmenu"Buy Strong Knife Cost : $5000""5"ADMIN_ALL)
}
public 
plugin_precache() {
engfunc(EngFunc_PrecacheModelmodel_mg3m_view)
engfunc(EngFunc_PrecacheModelmodel_m1887_view
engfunc(EngFunc_PrecacheModelmodel_xm8_view)
engfunc(EngFunc_PrecacheModelmodel_ddeagle_view)
engfunc(EngFunc_PrecacheModelmodel_strong_knife_view)
}
public 
handle_say(id) {
new 
command[32]
read_argv(1command31)
 
if (
equal(command"buymenu")) {
if (
is_user_alive(id)) {
Showmenu_CSO(id)
}
}
else {
client_print(idprint_chat"[ZP] You cannot buy a weapon while you are dead!")
}
}
public 
Showmenu_CSO(id) {
menu_display(idCSOmenu,0)
return 
PLUGIN_HANDLED
}
public 
do_CSOmenu(idMenuItem) {
new 
szCommand[3], AccesssCallbackECostDCostCCostBCostACost
ECost 
get_cvar_num("strong_knife_cost")
DCost get_cvar_num("ddeagle_cost")
CCost get_cvar_num("xm8_cost")
BCost get_cvar_num("m1887_cost")
ACost get_cvar_num("mg3m_cost")
menu_item_getinfo(MenuItemAccesssszCommand2__Callback)
switch(
szCommand[0]) {
case 
'-': {
return 
PLUGIN_HANDLED
}
case 
'1': {
if (
cs_get_user_money(id) >= ACost && !hasmg3m[id]) {
give_item_mg3m(id)
cs_set_user_money(idcs_get_user_money(id) - ACost)
client_print(idprint_chat"[ZP] You have bought a MG3M.")
}
if (
cs_get_user_money(id) < ACost) {
client_print(idprint_center"[ZP] You need $%i to buy this."ACost)
}
if (
hasmg3m[id]) {
client_print(idprint_center"[ZP] You already have a MG3M.")
}
}
case 
'2': {
if (
cs_get_user_money(id) >= BCost && !hasm1887[id]) {
give_item_m1887(id)
cs_set_user_money(idcs_get_user_money(id) - BCost)
client_print(idprint_chat"[ZP] You have bought a M1887.")
}
if (
cs_get_user_money(id) < BCost) {
client_print(idprint_center"[ZP] You need $%i to buy this."BCost)
}
if (
hasm1887[id]) {
client_print(idprint_center"[ZP] You already have a M1887.")
}
}
case 
'3': {
if (
cs_get_user_money(id) >= CCost && !hasxm8[id]) {
give_item_xm8(id)
cs_set_user_money(idcs_get_user_money(id) - CCost)
client_print(idprint_chat"[ZP] You have bought a XM8.")
}
if (
cs_get_user_money(id) < CCost) {
client_print(idprint_center"[ZP] You need $%i to buy this."CCost)
}
if (
hasxm8[id]) {
client_print(idprint_center"[ZP] You already have a XM8.")
}
}
case 
'4': {
if (
cs_get_user_money(id) >= DCost && !hasddeagle[id]) {
give_item_ddeagle(id)
cs_set_user_money(idcs_get_user_money(id) - DCost)
client_print(idprint_chat"[ZP] You have bought a Dual Deagle.")
}
if (
cs_get_user_money(id) < DCost) {
client_print(idprint_center"[ZP] You need $%i to buy this."DCost)
}
if (
hasddeagle[id]) {
client_print(idprint_center"[ZP] You already have a Dual Deagle.")
}
}
case 
'5': {
if (
cs_get_user_money(id) >= ECost && !hasstrong_knife[id]) {
give_item_strong_knife(id)
cs_set_user_money(idcs_get_user_money(id) - ECost)
client_print(idprint_chat"[ZP] You have bought a Strong Knife.")
}
if (
cs_get_user_money(id) < ECost) {
client_print(idprint_center"[ZP] You need $%i to buy this."ECost)
}
if (
hasstrong_knife[id]) {
client_print(idprint_center"[ZP] You already have a Strong Knife.")
}
}
}
return 
PLUGIN_HANDLED
}
public 
give_item_mg3m(id) {
hasmg3m[id] = true
new iWeapon give_item(id"weapon_m249")
if(
iWeapon) {
cs_set_weapon_ammo(iWeapon150)
cs_set_user_bpammo(idiWeapon300)
}
}
public 
give_item_m1887(id) {
hasm1887[id] = true
new iWeapon2 give_item(id"weapon_m3")
if(
iWeapon2) {
cs_set_weapon_ammo(iWeapon28)
cs_set_user_bpammo(idiWeapon232)
}
}
public 
give_item_xm8(id) {
hasxm8[id] = true
new iWeapon3 give_item(id"weapon_sg552")
if(
iWeapon3) {
cs_set_weapon_ammo(iWeapon340)
cs_set_user_bpammo(idiWeapon3120)
}
}
public 
give_item_ddeagle(id) {
hasddeagle[id] = true
new iWeapon4 give_item(id"weapon_elite")
if(
iWeapon4) {
cs_set_weapon_ammo(iWeapon414)
cs_set_user_bpammo(idiWeapon442)
}
}
public 
give_item_strong_knife(id) {
hasstrong_knife[id] = true
give_item
(id"weapon_knife")
}
public 
event_curweapon(id) {
new 
weapon read_data(2);
new 
ammo read_data(3);
if(
g_curWpn[id][0] != weapon) {
g_curWpn[id][0] = weapon;
g_curWpn[id][1] = ammo;
}
if(
g_curWpn[id][1] < ammo) {
g_curWpn[id][1] = ammo;
if (
weapon CSW_M249 && is_user_alive(id) && hasmg3m[id])
cs_set_weapon_ammo(weapon150)
else if (
weapon CSW_SG552 && is_user_alive(id) && hasxm8[id])
cs_set_weapon_ammo(weapon40)
else if (
weapon CSW_ELITE && is_user_alive(id) && hasddeagle[id])
cs_set_weapon_ammo(weapon14)
}
 
 
new 
weaponID read_data(2)
if (
weaponID CSW_M249 && is_user_alive(id) && hasmg3m[id])
set_pev(idpev_viewmodel2model_mg3m_view)
else if (
weaponID CSW_M3 && is_user_alive(id) && hasm1887[id])
set_pev(idpev_viewmodel2model_m1887_view)
else if (
weaponID CSW_SG552 && is_user_alive(id) && hasxm8[id])
set_pev(idpev_viewmodel2model_xm8_view)
else if (
weaponID CSW_ELITE && is_user_alive(id) && hasddeagle[id])
set_pev(idpev_viewmodel2model_ddeagle_view)
else if (
weaponID CSW_KNIFE && is_user_alive(id) && hasstrong_knife[id])
set_pev(idpev_viewmodel2model_strong_knife_view)
}
public 
event_Damage(id) {
if(!
is_user_alive(id))
return 
PLUGIN_CONTINUE;
new 
weapon attacker get_user_attacker(id weapon);
if(
weapon == CSW_M3 && is_user_alive(attacker) && hasm1887[attacker]) {
new 
Float:vec[3];
new 
Float:oldvelo[3];
get_user_velocity(idoldvelo);
create_velocity_vector(id attacker vec);
vec[0] += oldvelo[0];
vec[1] += oldvelo[1];
set_user_velocity(id vec);
}
return 
PLUGIN_CONTINUE;
}
stock create_velocity_vector(victim,attacker,Float:velocity[3]) {
if(!
is_user_alive(victim) || !is_user_alive(attacker) || !hasm1887[attacker])
return 
0;
new 
Float:vicorigin[3];
new 
Float:attorigin[3];
entity_get_vector(victim EV_VEC_origin vicorigin);
entity_get_vector(attacker EV_VEC_origin attorigin);
new 
Float:origin2[3]
origin2[0] = vicorigin[0] - attorigin[0];
origin2[1] = vicorigin[1] - attorigin[1];
new 
Float:largestnum 0.0;
if(
floatabs(origin2[0])>largestnumlargestnum floatabs(origin2[0]);
if(
floatabs(origin2[1])>largestnumlargestnum floatabs(origin2[1]);
origin2[0] /= largestnum;
origin2[1] /= largestnum;
velocity[0] = ( origin2[0] * 100 3000 ) / get_entity_distance(victim attacker);
velocity[1] = ( origin2[1] * 100 3000 ) / get_entity_distance(victim attacker);
if(
velocity[0] <= 20.0 || velocity[1] <= 20.0)
velocity[2] = random_float(200.0 275.0);
return 
1;
}
public 
Player_TakeDamage(idinflictorattackerFloat:damagedamagebits) {
new 
weaponID read_data(2)
if(!(
<= attacker <= g_iMaxPlayers) || attacker != inflictor || weaponID != CSW_KNIFE || !hasstrong_knife[attacker])
return 
HAM_IGNORED;
else 
SetHamParamFloat(4damage 5);
if(!(
<= attacker <= g_iMaxPlayers) || attacker != inflictor || weaponID != CSW_ELITE || !hasddeagle[attacker])
return 
HAM_IGNORED;
else 
SetHamParamFloat(4damage 2);
return 
HAM_HANDLED

Or... you can download it below. I'm a noobie coder so dont blame me for my bad coding.
Attached Files
File Type: sma Get Plugin or Get Source (cso_weaponmenu.sma - 483 views - 9.2 KB)
__________________

Last edited by Zombie Lurker; 05-25-2009 at 18:42.
Zombie Lurker is offline
--kml--
Senior Member
Join Date: Jan 2009
Old 05-25-2009 , 09:23   Re: [Help] Edit my Codes
Reply With Quote #2

hmmmm can give the error list? xD

ediT:

you must post in more details as in the error list and some other things why it got error and try to use PHP code for codes as it make it looks more good too see.

this is some good things for posting help LOL
maybe not a good TUT but oh well it is my TUT

1. Tittle
2 . some spaces
3 . give some explanation about the tittle
4. then say about the errors/debug
5. give an explanation why it becomes error or it is already like that
6. IF u can (only if u want) say why u make that plugin or help .
so that people can help you more easly
7. give out the PHP code ( if u want)
8. use some crabs smiley
__________________
wooT now is asking season
will ask you plenty of things for learning

Last edited by --kml--; 05-25-2009 at 09:38.
--kml-- is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 05-25-2009 , 09:25   Re: [Help] Edit my Codes
Reply With Quote #3

Add debug to the plugin in plugins.ini and post the errors.
__________________
Bugsy is offline
Zombie Lurker
Senior Member
Join Date: Mar 2009
Old 05-25-2009 , 10:00   Re: [Help] Edit my Codes
Reply With Quote #4

Updated first post with the problems. And here's some answers for --kml--:

1. There is already a title...
2. Spaces? looks like there are spaces...
3. I'd like somebody to edit my codes so it would work properly.
4. Errors are in first post.
5. It's already like that...
6. I made this plugin for me personal use. But anyone can copy it and edit.
7. I dont have a PHP code for it...
8. Must I really use some crab smileys?
__________________
Zombie Lurker is offline
--kml--
Senior Member
Join Date: Jan 2009
Old 05-25-2009 , 10:06   Re: [Help] Edit my Codes
Reply With Quote #5

1.i meant by like this
at the top of your post copy back your tittle example:

[Help] Edit my Codes
SPACE
SPACE
SPACE


2. refer 1

4. this is also for some1 else thats why i add some other things xD


7. php code is like this

PHP Code:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <engine>
#include <fakemeta>
#include <fun>
#include <cstrike>
#include <hamsandwich>
#define PLUGIN "CSO Weapon Menu"
#define VERSION "1.0"
#define AUTHOR "Zombie Lurker"
#define CSO_MENUKEYS (1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<4)|(1<<5)|(1<<6)|(1<<7)|(1<<8)|(1<<9)
new bool:hasmg3m[32], hasm1887[32], hasxm8[32], hasddeagle[32], hasstrong_knife[32]
new 
CSOmenug_iMaxPlayersg_curWpn[33][2];
new const 
model_mg3m_view[] = "models/zombie_plague/v_mg3m.mdl"
new const model_m1887_view[] = "models/zombie_plague/v_m1887.mdl"
new const model_xm8_view[] = "models/zombie_plague/v_xm8.mdl"
new const model_ddeagle_view[] = "models/zombie_plague/v_ddeagle.mdl"
new const model_strong_knife_view[] = "models/zombie_plague/v_strong_knife.mdl"
public plugin_init() {
 
register_plugin(PLUGINVERSIONAUTHOR)
 
 
register_cvar("mg3m_cost""10000")
 
register_cvar("m1887_cost""10000")
 
register_cvar("xm8_cost""8000")
 
register_cvar("ddeagle_cost""5000")
 
register_cvar("strong_knife_cost""5000")
 
g_iMaxPlayers get_maxplayers()
 
 
register_event("Damage" "event_Damage" "b" "2>0");
 
RegisterHamHam_TakeDamage"player""Player_TakeDamage" );
 
 
register_clcmd("say""handle_say")
 
register_clcmd("say_team""handle_say")
 
 
CSOmenu menu_create("CSO Weapon Menu""do_CSOmenu")
 
menu_additem(CSOmenu"Buy MG3M""1"ADMIN_ALL)
 
menu_additem(CSOmenu"Buy M1887""2"ADMIN_ALL)
 
menu_additem(CSOmenu"Buy XM8""3"ADMIN_ALL)
 
menu_additem(CSOmenu"Buy Dual Deagles""4"ADMIN_ALL)
 
menu_additem(CSOmenu"Buy Strong Knife""5"ADMIN_ALL)
}
public 
plugin_precache() {
 
engfunc(EngFunc_PrecacheModelmodel_mg3m_view)
 
engfunc(EngFunc_PrecacheModelmodel_m1887_view
 
engfunc(EngFunc_PrecacheModelmodel_xm8_view)
 
engfunc(EngFunc_PrecacheModelmodel_ddeagle_view)
 
engfunc(EngFunc_PrecacheModelmodel_strong_knife_view)
}
public 
handle_say(id) {
 new 
command[32]
 
read_argv(1command31)
 
 if (
equal(command"buymenu")) {
  if (
is_user_alive(id)) {
   
Showmenu_CSO(id)
  }
 }
 else {
  
client_print(idprint_chat"[ZP] You cannot buy a weapon while you are dead!")
 }
}
public 
Showmenu_CSO(id) {
 
menu_display(idCSOmenu,0)
 return 
PLUGIN_HANDLED
}
public 
do_CSOmenu(idMenuItem) {
 new 
szCommand[3],  AccesssCallbackECostDCostCCostBCostACost
 ECost 
get_cvar_num("strong_knife_cost")
 
DCost get_cvar_num("ddeagle_cost")
 
CCost get_cvar_num("xm8_cost")
 
BCost get_cvar_num("m1887_cost")
 
ACost get_cvar_num("mg3m_cost")
 
menu_item_getinfo(MenuItemAccesssszCommand2__Callback)
 switch(
szCommand[0]) {
  case 
'-': {
   return 
PLUGIN_HANDLED
  
}
  case 
'1': {
   if (
cs_get_user_money(id) >= ACost && !hasmg3m[id]) {
    
give_item_mg3m(id)
    
cs_set_user_money(idcs_get_user_money(id) - ACost)
    
client_print(idprint_chat"[ZP] You have bought a MG3M.")
   }
   if (
cs_get_user_money(id) < ACost) {
    
client_print(idprint_center"[ZP] You need $%i to buy this."ACost)
   }
   if (
hasmg3m[id]) {
    
client_print(idprint_center"[ZP] You already have a MG3M.")
   }
  }
  case 
'2': {
   if (
cs_get_user_money(id) >= BCost && !hasm1887[id]) {
    
give_item_m1887(id)
    
cs_set_user_money(idcs_get_user_money(id) - BCost)
    
client_print(idprint_chat"[ZP] You have bought a M1887.")
   }
   if (
cs_get_user_money(id) < BCost) {
    
client_print(idprint_center"[ZP] You need $%i to buy this."BCost)
   }
   if (
hasm1887[id]) {
    
client_print(idprint_center"[ZP] You already have a M1887.")
   }
  }
  case 
'3': {
   if (
cs_get_user_money(id) >= CCost && !hasxm8[id]) {
    
give_item_xm8(id)
    
cs_set_user_money(idcs_get_user_money(id) - CCost)
    
client_print(idprint_chat"[ZP] You have bought a XM8.")
   }
   if (
cs_get_user_money(id) < CCost) {
    
client_print(idprint_center"[ZP] You need $%i to buy this."CCost)
   }
   if (
hasxm8[id]) {
    
client_print(idprint_center"[ZP] You already have a XM8.")
   }
  }
  case 
'4': {
   if (
cs_get_user_money(id) >= DCost && !hasddeagle[id]) {
    
give_item_ddeagle(id)
    
cs_set_user_money(idcs_get_user_money(id) - DCost)
    
client_print(idprint_chat"[ZP] You have bought a Dual Deagle.")
   }
   if (
cs_get_user_money(id) < DCost) {
    
client_print(idprint_center"[ZP] You need $%i to buy this."DCost)
   }
   if (
hasddeagle[id]) {
    
client_print(idprint_center"[ZP] You already have a Dual Deagle.")
   }
  }
  case 
'5': {
   if (
cs_get_user_money(id) >= ECost && !hasstrong_knife[id]) {
    
give_item_strong_knife(id)
    
cs_set_user_money(idcs_get_user_money(id) - ECost)
    
client_print(idprint_chat"[ZP] You have bought a Strong Knife.")
   }
   if (
cs_get_user_money(id) < ECost) {
    
client_print(idprint_center"[ZP] You need $%i to buy this."ECost)
   }
   if (
hasstrong_knife[id]) {
    
client_print(idprint_center"[ZP] You already have a Strong Knife.")
   }
  }
 }
 return 
PLUGIN_HANDLED
}
public 
give_item_mg3m(id) {
 
hasmg3m[id] = true
 
new iWeapon give_item(id"weapon_m249")
 if(
iWeapon) {
  
cs_set_weapon_ammo(iWeapon150)
  
cs_set_user_bpammo(iWeapon300)
 }
}
public 
give_item_m1887(id) {
 
hasm1887[id] = true
 
new iWeapon2 give_item(id"weapon_m3")
 if(
iWeapon2) {
  
cs_set_weapon_ammo(iWeapon28)
  
cs_set_user_bpammo(iWeapon232)
 }
}
public 
give_item_xm8(id) {
 
hasxm8[id] = true
 
new iWeapon3 give_item(id"weapon_sg552")
 if(
iWeapon3) {
  
cs_set_weapon_ammo(iWeapon340)
  
cs_set_user_bpammo(iWeapon3120)
}
public 
give_item_ddeagle(id) {
 
hasddeagle[id] = true
 
new iWeapon4 give_item(id"weapon_elite")
 if(
iWeapon4) {
  
cs_set_weapon_ammo(iWeapon414)
  
cs_set_user_bpammo(iWeapon442)
 }
}
public 
give_item_strong_knife(id) {
 
hasstrong_knife[id] = true
 give_item
(id"weapon_knife")
}
public 
event_curweapon(id) {
 new 
weapon read_data(2);
 new 
ammo read_data(3);
 if(
g_curWpn[id][0] != weapon) {
  
g_curWpn[id][0] = weapon;
  
g_curWpn[id][1] = ammo;
 }
 if(
g_curWpn[id][1] < ammo) {
  
g_curWpn[id][1] = ammo;
  if (
weapon CSW_M249 && is_user_alive(id) && hasmg3m[id])
   
cs_set_weapon_ammo(weapon150)
  else if (
weapon CSW_SG552 && is_user_alive(id) && hasxm8[id])
   
cs_set_weapon_ammo(weapon40)
  else if (
weapon CSW_ELITE && is_user_alive(id) && hasddeagle[id])
   
cs_set_weapon_ammo(weapon14)
 }
 
 
 new 
weaponID read_data(2)
 if (
weaponID CSW_M249 && is_user_alive(id) && hasmg3m[id])
  
set_pev(idpev_viewmodel2model_mg3m_view)
 else if (
weaponID CSW_M3 && is_user_alive(id) && hasm1887[id])
  
set_pev(idpev_viewmodel2model_m1887_view)
 else if (
weaponID CSW_SG552 && is_user_alive(id) && hasxm8[id])
  
set_pev(idpev_viewmodel2model_xm8_view)
 else if (
weaponID CSW_ELITE && is_user_alive(id) && hasddeagle[id])
  
set_pev(idpev_viewmodel2model_ddeagle_view)
 else if (
weaponID CSW_KNIFE && is_user_alive(id) && hasstrong_knife[id])
  
set_pev(idpev_viewmodel2model_strong_knife_view)
}
public 
event_Damage(id) {
 if(!
is_user_alive(id))
  return 
PLUGIN_CONTINUE;
 new 
weapon attacker get_user_attacker(id weapon);
 if(
weapon == CSW_M3 && is_user_alive(attacker) && hasm1887[attacker]) {
  new 
Float:vec[3];
  new 
Float:oldvelo[3];
  
get_user_velocity(idoldvelo);
  
create_velocity_vector(id attacker vec);
  
vec[0] += oldvelo[0];
  
vec[1] += oldvelo[1];
  
set_user_velocity(id vec);
 }
 return 
PLUGIN_CONTINUE;
}
stock create_velocity_vector(victim,attacker,Float:velocity[3]) {
 if(!
is_user_alive(victim) || !is_user_alive(attacker) || !hasm1887[attacker])
  return 
0;
 new 
Float:vicorigin[3];
 new 
Float:attorigin[3];
 
entity_get_vector(victim   EV_VEC_origin vicorigin);
 
entity_get_vector(attacker EV_VEC_origin attorigin);
 new 
Float:origin2[3]
 
origin2[0] = vicorigin[0] - attorigin[0];
 
origin2[1] = vicorigin[1] - attorigin[1];
 new 
Float:largestnum 0.0;
 if(
floatabs(origin2[0])>largestnumlargestnum floatabs(origin2[0]);
 if(
floatabs(origin2[1])>largestnumlargestnum floatabs(origin2[1]);
 
origin2[0] /= largestnum;
 
origin2[1] /= largestnum;
 
velocity[0] = ( origin2[0] * 10 3000 ) / get_entity_distance(victim attacker);
 
velocity[1] = ( origin2[1] * 10 3000 ) / get_entity_distance(victim attacker);
 if(
velocity[0] <= 20.0 || velocity[1] <= 20.0)
  
velocity[2] = random_float(200.0 275.0);
 return 
1;
}
public 
Player_TakeDamage(idinflictorattackerFloat:damagedamagebits) {
 new 
weaponID read_data(2)
 if(!(
<= attacker <= g_iMaxPlayers) || attacker != inflictor || weaponID != CSW_KNIFE || !hasstrong_knife[attacker])
  return 
HAM_IGNORED;
 else 
SetHamParamFloat(4damage 5);
 if(!(
<= attacker <= g_iMaxPlayers) || attacker != inflictor || weaponID != CSW_ELITE || !hasddeagle[attacker])
  return 
HAM_IGNORED;
 else 
SetHamParamFloat(4damage 2);
 return 
HAM_HANDLED


see? try go advanced and see the php icon.

8. well i like too put crabs smileys

__________________
wooT now is asking season
will ask you plenty of things for learning

Last edited by --kml--; 05-25-2009 at 10:19.
--kml-- is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 05-25-2009 , 10:13   Re: [Help] Edit my Codes
Reply With Quote #6

You are using cs_set_user_bpammo and cs_set_weapon_ammo incorrectly, proper usage:

http://www.amxmodx.org/funcwiki.php?go=func&id=186

http://www.amxmodx.org/funcwiki.php?go=func&id=208

cs_set_weapon_ammo is a bit more tricky because you need to pass the entity id, not the weapon index. There is an example in the function thread at the bottom; not sure if it works.
Make all of those corrections and then see what errors are left.
__________________
Bugsy is offline
Zombie Lurker
Senior Member
Join Date: Mar 2009
Old 05-25-2009 , 10:14   Re: [Help] Edit my Codes
Reply With Quote #7

So... can you help me or not? Its ok if you cant, but I sure want this plugin to be fixed by someone.

[EDIT]
I fixed the problem. Thanks to Bugsy for helping me!
__________________

Last edited by Zombie Lurker; 05-25-2009 at 10:19.
Zombie Lurker is offline
--kml--
Senior Member
Join Date: Jan 2009
Old 05-25-2009 , 10:20   Re: [Help] Edit my Codes
Reply With Quote #8

seen bugsy post?

i am just helping but not solving LOL
still browsing the help forums
and u edited your post xD
__________________
wooT now is asking season
will ask you plenty of things for learning
--kml-- is offline
Zombie Lurker
Senior Member
Join Date: Mar 2009
Old 05-25-2009 , 18:36   Re: *FIXED* [Help] Edit my Codes *FIXED*
Reply With Quote #9

=.= I gotta rechange the title again now. I still have problems with it. Like for instance the menu isnt working properly, the weapon model doesnt change, you get the weapon free sometimes and some other stuff.. XD
__________________
Zombie Lurker is offline
--kml--
Senior Member
Join Date: Jan 2009
Old 05-25-2009 , 19:41   Re: [Help] Fix my Codes
Reply With Quote #10

maybe you should reffer to meryclyzz zombie plauge. try too study the code xD
it may help you many things
MORE CRABS SMILEY
__________________
wooT now is asking season
will ask you plenty of things for learning
--kml-- is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 01:32.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode