![]() |
How Could I... - Printable Version +- Mirage Source (https://mirage-engine.uk/forums) +-- Forum: Mirage Source (Nostalgia) (https://mirage-engine.uk/forums/forumdisplay.php?fid=61) +--- Forum: Archive (2006-2011) (https://mirage-engine.uk/forums/forumdisplay.php?fid=18) +---- Forum: General (https://mirage-engine.uk/forums/forumdisplay.php?fid=17) +---- Thread: How Could I... (/showthread.php?tid=2099) Pages:
1
2
|
How Could I... - DarkC - 15-09-2008 I'm trying to make a code that checks a player's inventory, and if they have a certain item in their inventory and they type something, then it activates. I hope that makes sense...But I don't know how to check a player's inventory and check the items they have's names. Can anyone tell me how to do that? Re: How Could I... - DarkC - 15-09-2008 Never used HasItem before...So would this work? I'm use MS4, and I have this in modHandleData I'm still learning VB6, so please excuse my mistakes. Up till now, I've just edited other people's code to fit what I need. This is my first code that I've started from scratch... Re: How Could I... - DarkC - 16-09-2008 So then this should work, correct? Thanks for your help. And it'll check if they have the item that is number 200 right? (this is in modGameLogic in the Client) Code: ' AIDA command (this is in modHandleData in the server) Code: ' ::::::::::::::::: Re: How Could I... - DarkC - 16-09-2008 Alrighty...Thanks allot. Now, when I try to compile the code. It's giving me an error on this...It was working fine before I added the AIDA code, I added the AIDA code above the CKillPlayer code, if that matters. It's highlighting "Case CKillPlayer" and giving me this error "Case Without Select Case". What do I do to fix it? It was working fine before... Code: ' :::::::::::::::::::::::: Re: How Could I... - DarkC - 16-09-2008 Thank you once again, that fixed it...But now I have a new problem when I compile it. lol I'm getting an error in this part of my code. Code: Public Sub Aida() It's highlighting "SetPlayerVital(Index, HP) =" and saying "Argument not optional". I've never gotten that error before, so I have no clue what it means. =/ Re: How Could I... - Nean - 16-09-2008 DarkC Wrote:Thank you once again, that fixed it...But now I have a new problem when I compile it. lol Try putting MyIndex, instead of index. Re: How Could I... - DarkC - 16-09-2008 I put MyIndex, and it's giving me the same error. Re: How Could I... - DarkC - 16-09-2008 What am I doing wrong? I looked and I don't get it...How can I tell what the correct way of using it is? Re: How Could I... - Jacob - 16-09-2008 Argument not optional - Check what you need to pass to that function Re: How Could I... - DarkC - 16-09-2008 Then like this? Sorry about all the trouble. ![]() Code: Public Sub Aida() Re: How Could I... - DarkC - 16-09-2008 Well when I don't have a = in there somewhere, it makes the text read and says it exspects a = . Re: How Could I... - DarkC - 16-09-2008 Ok...I added call to it, and now it's highlighting GetPlayerMaxVital and giving the same error. :oops: Re: How Could I... - Rian - 16-09-2008 Then do the same thing to fix it. Re: How Could I... - DarkC - 16-09-2008 But how can I have it be Called when it's in the parentheses? Because doesn't it have to be there? Because that's where the Value is supposed to be in the SetPlayerVital... Re: How Could I... - Rian - 16-09-2008 Functions don't need a call. You can just do GetPlayerMaxVital(index, whatever, whatever) Re: How Could I... - Anthony - 16-09-2008 Does your code still look like this? Code: Public Sub Aida() If so, look at the SetPlayerVital sub. Code: Sub SetPlayerVital(ByVal Index As Long, ByVal Vital As Vitals, ByVal Value As Long) Just that part is all that really matters. You are setting it to the Index (which would be your player number), which vital do you want to set, then the value you want to set it to. Make sense? So if you want to set your vital hp to 5000 then your code should look like this. Code: Public Sub Aida() I am not exactly sure what you are trying to do? Re: How Could I... - DarkC - 16-09-2008 Never mind! Thank you, Anthony. That helped me perfectly. Thank you all for your help. Re: How Could I... - DarkC - 16-09-2008 Ok...I was able to compile it without any errors, but it's not working. I'm typing "/aida" and it doesn't do anything. It's not even getting rid of the text after I type it and press enter. Here is my code so far... Code: ' AIDA command Code: ' ::::::::::::::::: Code: Public Sub Aida() What have I done wrong? Sorry for all the trouble... Re: How Could I... - Nean - 16-09-2008 On the aida packet, try putting the exit sub, before the end if. Re: How Could I... - DarkC - 16-09-2008 Just tried that, didn't change anything. It's doing the exact same thing... Re: How Could I... - DarkC - 16-09-2008 Ok...Well if you could figure out why it isn't working, that would be wonderful. Thank you so much. Also, I changed this... Code: ' AIDA command And now when I type "/aida" it gets rid of the text after I press enter. But it doesn't do anything else. Re: How Could I... - Anthony - 16-09-2008 I still don't see what you are trying to set your HP value to? Code: Function GetPlayerMaxVital(ByVal Index As Long, ByVal Vital As Vitals) As Long There are only an Index and a Vital as Vitals in the function. Yours is looking to select something else as well. If you want to set your players hit points to whatever your max hit points are plus 5000 it should be like this. Code: Call SetPlayerVital(Index, Vitals.HP, GetPlayerMaxVital(Index, Vitals.HP) + 5000) Do you understand how that works? You cannot change the MaxHP value in a default MS because it is calculated from your players stats and it's classes stats. Re: How Could I... - DarkC - 16-09-2008 Anthony Wrote:I still don't see what you are trying to set your HP value to? That's exactly what I'm trying to do. I want to set the player's max HP + 5000. And I think I get how that works...So the code you just showed me, is correct? I'll have to try it later when I get back home from school. Re: How Could I... - Rian - 16-09-2008 DarkC Wrote:That's exactly what I'm trying to do. I want to set the player's max HP + 5000. And I think I get how that works...So the code you just showed me, is correct? I'll have to try it later when I get back home from school. Anthony Wrote:You cannot change the MaxHP value in a default MS because it is calculated from your players stats and it's classes stats. Re: How Could I... - DarkC - 16-09-2008 How could I increase their MaxHP then? |