Raised This Month: $ Target: $400
 0% 

need help ! please!!


Post New Thread Reply   
 
Thread Tools Display Modes
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
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 06-21-2009 , 04:41   Re: need help ! please!!
Reply With Quote #2

You have to compile it localy since "chatcolor" is a third party include.

Edit: You can compile it. Misread. What's the problem exactly so ?
__________________

Last edited by Arkshine; 06-21-2009 at 04:43.
Arkshine is offline
K.K.Lv
Veteran Member
Join Date: Aug 2008
Location: GameFolder
Old 06-21-2009 , 04:44   Re: need help ! please!!
Reply With Quote #3

can you give me some example ?
K.K.Lv is offline
Send a message via MSN to K.K.Lv
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 06-21-2009 , 05:13   Re: need help ! please!!
Reply With Quote #4

Example of what ? Sorry I don't understand. You said you can compile it but "can't be used". It doesn't help at all and it would nice if you can provide more informations on the problem.
__________________
Arkshine is offline
K.K.Lv
Veteran Member
Join Date: Aug 2008
Location: GameFolder
Old 06-21-2009 , 05:26   Re: need help ! please!!
Reply With Quote #5

I mean if the code have some problem ,can you point it out and corrent it !
sorry for my bad english!!
K.K.Lv is offline
Send a message via MSN to K.K.Lv
-Acid-
Senior Member
Join Date: Feb 2009
Old 06-21-2009 , 19:43   Re: need help ! please!!
Reply With Quote #6

in include do u mean colorchat??
__________________
-Acid- is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 06-21-2009 , 19:45   Re: need help ! please!!
Reply With Quote #7

Quote:
Originally Posted by -Acid- View Post
in include do u mean colorchat??
No.
http://forums.alliedmods.net/showthread.php?t=94960
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
-Acid-
Senior Member
Join Date: Feb 2009
Old 06-21-2009 , 19:48   Re: need help ! please!!
Reply With Quote #8

Quote:
Originally Posted by Exolent[jNr] View Post
COOL I WAS WRONG!!!!!!
__________________
-Acid- is offline
K.K.Lv
Veteran Member
Join Date: Aug 2008
Location: GameFolder
Old 06-22-2009 , 02:05   Re: need help ! please!!
Reply With Quote #9

yeah !!Exolent !!
I just used 'chatcolor.inc'!!
but I think the problem is not at this!!
K.K.Lv is offline
Send a message via MSN to K.K.Lv
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 15:40.


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