Показать сообщение отдельно
Старый 14.01.2006, 10:12   #21
alcosholik
 
Сообщений: n/a
Код Платона:
Так если у тебя есть тип оружия - добавь туда поле скорострельность, а потом когда вызываешь функцию выстрела - вызывай ее по таймеру, параметром которого будет скорострельность.
Type Weapon 
 * * * field firerate 
 * * *;... 
end type 
 
access_shoot=true 
;.... 
 
if down_key_shoot and access_shoot then 
 * * Shot() 
 * * access_shoot=false 
end if 
 * * access_shoot=GetTime(CurrWeapon\firerate) 
 
;... 
; Это таймер 
 
Global orig,out 
Function GetTime(firerate) 
 If Not out>=(600/firerate) Then 
 *out=MilliSecs()-orig 
 Else 
 *orig=MilliSecs() 
 *out=0 
 *Return True 
 End If 
 Return False 
End Function
 
Ответить с цитированием