-
Notifications
You must be signed in to change notification settings - Fork 50
Manual:DIL Manual weapon info()
iamnove edited this page Jan 18, 2023
·
55 revisions
Function: intlist weapon_info( i : integer ) ;
i Weapon to get the info of ass defined in 'values.h' and 'weapons.def' returns Intlist containing 4 values:
0 Number of hands 1 weapon speed 2 weapon type 3 shield block value
This function gives you access to the values in the weapons.def file. With this things like 'wear' equipment' and 'look' are much easier to write in Dil. Example ---~---~---~---~---~---~---~---~---
dilcopy id_weap (arg:string); var i:integer; il:intlist; code { il:=weapon_info(atoi(arg));
if (il!=null) { sendtext ("Number of hands: "+itoa(il.[0])+"&n"; sendtext ("Speed: " +itoa(il.[1])+"&n",self); sendtext ("Type: "+itoa(il.[0])+"&n",self); sendtext ("Shield value: "+itoa(il.[0])+"&n",self); } else { sendtext ("No such weapon.&n",self); }
quit; } dilend
---~---~---~---~---~---~---~---~---