Calalin Posted November 28, 2012 Author Share Posted November 28, 2012 Hi all,How I can do an action when a player unequip an item ?I have make this script :```If itemnum = 6 ThenCall SetPlayerStat(index, Strength, GetPlayerStat(index, Strength) - 5)Call PlayerMsg(index, "You lose strength !", Yellow)End If```But I don't know where to put it… ^^Thanks for your help !PS : Sorry for my bad English ^^ Link to comment Share on other sites More sharing options...
Matt Posted November 28, 2012 Share Posted November 28, 2012 Look for this```' use item if not doing anything else```and put it right above it. Link to comment Share on other sites More sharing options...
Calalin Posted November 28, 2012 Author Share Posted November 28, 2012 Thanks for your answer !I have tried my code in server side.Is there an equivalence for "itemnum" in client side ?Thanks ! Link to comment Share on other sites More sharing options...
Matt Posted November 28, 2012 Share Posted November 28, 2012 There isn't, but if the item's name is unique enough, you could alternatively use``` if item(GetPlayerInvItemNum(MyIndex, InvNum)).name = "Name here" then``` Link to comment Share on other sites More sharing options...
Calalin Posted November 28, 2012 Author Share Posted November 28, 2012 Thanks for your help, but it's not ok in my house :I have created an item and I call It "Admin"This is my code :```If Item(GetPlayerInvItemNum(MyIndex, invNum)).Name = "Admin" Then Call SayMsg("Test")End If```Have you got an idea ?Thanks !! ![:)](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/smile.png) Link to comment Share on other sites More sharing options...
Matt Posted November 28, 2012 Share Posted November 28, 2012 That should be fine ![:D](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/biggrin.png) Link to comment Share on other sites More sharing options...
Calalin Posted November 28, 2012 Author Share Posted November 28, 2012 Okay thanks you ^^I will search why it's not ok in my house ^^ Link to comment Share on other sites More sharing options...
tslusny Posted November 28, 2012 Share Posted November 28, 2012 Try use Trim( Link to comment Share on other sites More sharing options...
Calalin Posted November 28, 2012 Author Share Posted November 28, 2012 Like that :If Item(GetPlayerInvItemNum(MyIndex, invNum)).Name = Trim("Admin") ThenIt's no good for me ^^Thanks you for your answer Link to comment Share on other sites More sharing options...
Matt Posted November 28, 2012 Share Posted November 28, 2012 No no. Trim(item(getplayerinvitemnum(myindex, invnum)).name) Link to comment Share on other sites More sharing options...
Calalin Posted November 28, 2012 Author Share Posted November 28, 2012 Nice it's works !!!Thanks you both ! Link to comment Share on other sites More sharing options...
Matt Posted November 28, 2012 Share Posted November 28, 2012 No problem! ![:D](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/biggrin.png) Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now