Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

[Resolved][EM] Add a new item's function


Calalin
 Share

Recommended Posts

Hi all,

Can you help me please ?

I will want add a new function on my item.

An item which changes the access.

For exemple, If a player equip the item "moderator power" he is going access 2.

And when he unequip he lose this access ^^

It's an exemple, of course ^^

Thanks !
Link to comment
Share on other sites

Make the Item_Type whatever you want (Should be equipable) then make a new data type say AccessAdd or something in ItemRec (Server & client) Then in use item, depending open which type of item it is (Helmet, legs etc) in the case after all checks add this line of code.

```

if item(itemnum).AccessAdd > 0 then

if player(index).access <= item(itemnum).accessadd then

player(index).access = item(itemnum).accessadd

end if

end if

```
Code modification might be neccessary. For unequipping it might be this code

```

if item(itemnum).accessadd > 0 then

player(index).access = player(index).access - item(itemnum).accessadd

```
again code modification might be neccessary.
Link to comment
Share on other sites

Thanks for your answer ![:)](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/smile.png)

I have seen this tuto : http://www.touchofdeathforums.com/community/index.php?/topic/128933-all-ver-script-system/page__hl__%2Bitem+%2Bscripted

It's functional for me ![;)](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/wink.png)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...