AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Touch model problem !!! (https://forums.alliedmods.net/showthread.php?t=99761)

manley.choi 08-09-2009 05:27

Touch model problem !!!
 
The amount of money over the prescribed limit, to touch the money model prompted the emergence of non-stop.
How to make prompt appears only once, to model the time to touch?
PHP Code:

public plugin_init()
{
 
register_touch("MoneyEnt""player""money_touch")
}
public 
money_touch(ptrptd)

 if (
total_money[ptd] >= 100000)
 {
  new 
msg[256]
  
format(msg255"^x03Your money more than ^x04$100000^x03 not need to pick.")
  
color_saytext(msgMSG_ONEptd3
        }  
 if (
is_user_alive(ptd) && (total_money[ptd] < g_maxmoney))
 {
  new 
owner entity_get_edict(ptrEV_ENT_owner)
  new 
Float:droptime entity_get_float(ptrEV_FL_fuser1)
  if(
owner==ptd && get_gametime()-droptime<0.3) return
  new 
money entity_get_int(ptrEV_INT_iuser2)
  
add_player_money(ptdmoney)
  new 
usergetmoney money
  
if (usergetmoney 999)
  {
   new 
name[32]
   
get_user_name(ptdname31)
   new 
msg[256]
   
format(msg255"^x03%s^x01 pick up ^x03$%d"nameusergetmoney)
   
client_color(0ptdmsg)
  }
  new 
leftmoney money usergetmoney
  
if (leftmoney g_maxmoney)
  {
   
remove_entity(ptr)
   
droped_money_count--
   } else {
   
entity_set_int(ptrEV_INT_iuser2leftmoney)
   if (
leftmoney 5000)
    
entity_set_model(ptrg_MoneyModel[2])
   else if (
leftmoney 10000)
    
entity_set_model(ptrg_MoneyModel[1])
   else
    
entity_set_model(ptrg_MoneyModel[0])
   new 
Float:maxbox[3] = {15.015.015.0}, Float:minbox[3] = {-15.0, -15.0, -15.0}
   
entity_set_size(ptrminboxmaxbox)
  }
 }




All times are GMT -4. The time now is 18:21.

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