AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   need help ! please!! (https://forums.alliedmods.net/showthread.php?t=95214)

K.K.Lv 06-21-2009 04:30

need help ! please!!
 
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)
 }



Arkshine 06-21-2009 04:41

Re: need help ! please!!
 
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 ?

K.K.Lv 06-21-2009 04:44

Re: need help ! please!!
 
can you give me some example ?

Arkshine 06-21-2009 05:13

Re: need help ! please!!
 
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.

K.K.Lv 06-21-2009 05:26

Re: need help ! please!!
 
I mean if the code have some problem ,can you point it out and corrent it !
sorry for my bad english!!

-Acid- 06-21-2009 19:43

Re: need help ! please!!
 
in include do u mean colorchat??

Exolent[jNr] 06-21-2009 19:45

Re: need help ! please!!
 
Quote:

Originally Posted by -Acid- (Post 853815)
in include do u mean colorchat??

No.
http://forums.alliedmods.net/showthread.php?t=94960

-Acid- 06-21-2009 19:48

Re: need help ! please!!
 
Quote:

Originally Posted by Exolent[jNr] (Post 853817)

COOL I WAS WRONG!!!!!!:):):)

K.K.Lv 06-22-2009 02:05

Re: need help ! please!!
 
yeah !!Exolent !!
I just used 'chatcolor.inc'!!
but I think the problem is not at this!!


All times are GMT -4. The time now is 15:40.

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