Raised This Month: $ Target: $400
 0% 

need help ! please!!


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
K.K.Lv
Veteran Member
Join Date: Aug 2008
Location: GameFolder
Old 06-21-2009 , 04:30   need help ! please!!
Reply With Quote #1

I made a plugin can drop money when user's weapon is knife !
can be compiled!
but can't be used !
look at the following code !
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <engine>
#include <chatcolor>
#define PLUGIN_NAME "Drop Money"
#define PLUGIN_VERSION "1.0"
#define PLUGIN_AUTHOR "K.K.Lv"
new bool:pickup[33]
new 
pMoneydroppMoneycountpMaxmoney
new iDropcountiEnt
new iMoneymodel[] = "models/money/Lvmoney.mdl"
public plugin_init()
{
 
register_plugin(PLUGIN_NAMEPLUGIN_VERSIONPLUGIN_AUTHOR)
 
 
register_logevent("New_round"2"1=Round_Start")
 
register_touch("MoneyDrop""player""hook_touch")
 
register_clcmd("drop""hookdrop")
 
pMoneydrop register_cvar("money_drop""1")
 
pMoneycount register_cvar("money_count""5000")
 
pMaxmoney register_cvar("amx_maxmoney""9999999")
}
public 
plugin_precache()
{
 
precache_model(iMoneymodel)
}
public 
hookdrop(id)
{
 if ((
get_user_weapon(id) == CSW_KNIFE) && get_pcvar_num(pMoneydrop))
 {
  new 
Float:velocity[3], Float:playervelocity[3], Float:origin[3], iMoneydrop random_num(30005000)
  new 
iMoney cs_get_user_money(id)
  if (
iMoney get_pcvar_num(pMoneycount))
  {
   
iDropcount++
   
cs_set_user_money(idiMoney iMoneydrop)
   
pickup[id] = false
   entity_get_vector
(idEV_VEC_originorigin)
   
entity_get_vector(idEV_VEC_velocityplayervelocity)
   
velocity_by_aim(id450velocity)
   
velocity[0] += playervelocity[0]
   
velocity[1] += playervelocity[1]
   
velocity[2] = 200
   velocity
[0] += random_float(0200)
   
velocity[1] += random_float(0200)
   
iEnt create_entity("info_target")
   
entity_set_string(iEntEV_SZ_classname"MoneyDrop")
   
entity_set_model(iEntiMoneymodel)
   
entity_set_origin(iEntorigin)
   
entity_set_int(iEntEV_INT_solidSOLID_TRIGGER)
   
entity_set_int(iEntEV_INT_movetypeMOVETYPE_TOSS)
   
entity_set_edict(iEntEV_ENT_ownerid)
   
entity_set_float(iEntEV_FL_fuser1get_gametime())
   
entity_set_int(iEntEV_INT_iuser3iMoneydrop)
   new 
Float:maxa[3], Float:mina[3]
   
maxa[0] = 15.0
   maxa
[1] = 15.0
   maxa
[2] = 15.0
 
   mina
[0] = -15.0
   mina
[1] = -15.0
   mina
[2] = -15.0
   entity_set_size
(iEntminamaxa)
  }
 }
}
public 
New_round()
{
 while((
iEnt find_ent_by_class(iEnt"MoneyDrop")) !=0)
 {
  
remove_entity(iEnt)
  
iDropcount--
 }
}
public 
hook_touch(ptrptid)
{
 if (
is_user_alive(ptid) && cs_get_user_money(ptid) < get_pcvar_num(pMaxmoney))
 {
  new 
iMoneypick entity_get_int(ptrEV_INT_iuser3)
  new 
iMoney cs_get_user_money(ptid)
  
cs_set_user_money(ptidiMoney iMoneypick)
  
remove_entity(ptr)
  
iDropcount--
  new 
iName[32], iMsg[128]
  
get_user_name(ptidiNamecharsmax(iName))
  
format(iMsgcharsmax(iMsg), "^x03%s ^x01pick up ^x03%d ^x01money"iNameiMoneypick)
  
client_print_color(0GreyiMsg)
 }

K.K.Lv is offline
Send a message via MSN to K.K.Lv
 



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 15:40.


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