![]() |
[MS4] Kill Command - 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: Source Code Development (https://mirage-engine.uk/forums/forumdisplay.php?fid=51) +----- Forum: Mirage Source 4 (Visual Basic 6) (https://mirage-engine.uk/forums/forumdisplay.php?fid=44) +------ Forum: Tutorials (https://mirage-engine.uk/forums/forumdisplay.php?fid=13) +------ Thread: [MS4] Kill Command (/showthread.php?tid=2094) Pages:
1
2
|
[MS4] Kill Command - DarkC - 15-09-2008 Ok...This code is for MS4, and what is does is if a admin with level 4 or higher access types "/kill (playernamehere)" they die, and get warped back to the starting area. I love MS4, it made making this code easier than it would have been in last MS. Anyway... Difficulty: 1/5 ::Client Side:: In modGameLogic under the following code: Code: ' // Commands // Add this: Code: ' Kill player Then in modEnumerations under the following code: Code: CGetClasses = 1 Add this: Code: CKillPlayer ::Server Side:: In modHandleData at the bottom, but before "End Sub" and "End Select" add the following code: Code: ' :::::::::::::::::::::::: Then in modEnumerations under the following code: Code: CGetClasses = 1 Add this: Code: CKillPlayer All done! I tested this out, and it worked perfectly. If you find any problems or errors, I'll be more than happy to try to resolve them for you. *update* If you want it in button format use the code below. Just change the "Txtchar.Text" part to whatever text box name you want it to get the name of the player you want to kill. Add this code rather than the "/kill" code above. Make sure you add ALL the other code in the tutorial above, you have to add everything else and it'll work. Code: Private Sub cmdkill_Click() Re: [MS4] Kill Command - DarkC - 15-09-2008 Why would it need to be elaborated any? It sends the player right to the starting area, X, and Y. Just like how I want it, people can specify another map, X, and Y if they wanted of course... Re: [MS4] Kill Command - DarkC - 15-09-2008 DFA Wrote:maybe based on race...class...faction....err level? PK status or not... Oh, I thought you meant something else. My mistake. This is just a simple version of the code, I might post variations of it like based on level and PK status like you suggested. Re: [MS4] Kill Command - Robin - 15-09-2008 Nice. Glad to see people writing up tutorials again. Re: [MS4] Kill Command - Nean - 15-09-2008 Robin Wrote:Nice. Glad to see people writing up tutorials again. As am I. Great job, DarkC. I'll be sure to use this. Re: [MS4] Kill Command - DarkC - 15-09-2008 Thanks, I'm glad you find it useful. Re: [MS4] Kill Command - skillzalot - 16-09-2008 Another nice tutorial Re: [MS4] Kill Command - Nean - 16-09-2008 So, lets say I wanted to add this to a button macro, and then type the users name in a textbox, called txtchar, and then push the kill button, and it will kill the char... How would I go about this. (If that makes sense) Re: [MS4] Kill Command - DarkC - 16-09-2008 Nean Wrote:So, lets say I wanted to add this to a button macro, and then type the users name in a textbox, called txtchar, and then push the kill button, and it will kill the char... How would I go about this. (If that makes sense) Basically you want it like Elysium Diamond has their Warp Me To command in the Admin Panel? If you want it like that, I'll try to figure out a way to do that tonight. Re: [MS4] Kill Command - Nean - 16-09-2008 DarkC Wrote:Nean Wrote:So, lets say I wanted to add this to a button macro, and then type the users name in a textbox, called txtchar, and then push the kill button, and it will kill the char... How would I go about this. (If that makes sense) If it helps, this is what I'm trying to do, only with your /kill command Code: Private Sub cmdkick_Click() Re: [MS4] Kill Command - DarkC - 16-09-2008 You should be able to do this...Someone correct me if I'm wrong, as to I haven't tested this out, sense I'm working on something else at the moment. But I'm pretty sure this'll work... Code: Private Sub cmdkill_Click() Then you just need to add the CKillPlayer into the modEnumerations of course, and add all the code in my tutorial to the server. Then it should work...Tell me if it does. =D Re: [MS4] Kill Command - Nean - 16-09-2008 DarkC Wrote:You should be able to do this...Someone correct me if I'm wrong, as to I haven't tested this out, sense I'm working on something else at the moment. But I'm pretty sure this'll work... It says "You cannot kill yourself" It's targeting me, because theres no way to make it link to the textbox. Thats all I need to know, is how to make it link to the textbox, rather than mytext. EDIT: This worked: Code: Private Sub cmdkill_Click() Re: [MS4] Kill Command - DarkC - 16-09-2008 Oopsie, meant to put that in there. Just forgot to. xD Re: [MS4] Kill Command - Nean - 16-09-2008 DarkC Wrote:Oopsie, meant to put that in there. Just forgot to. xD Regardless, your idea lead to me getting it. So thanks! Re: [MS4] Kill Command - DarkC - 16-09-2008 No problem, thanks for showing interest. =D I updated the first post with the button code for in the future if someone wants it that way. Re: [MS4] Kill Command - Nean - 18-09-2008 I found an error with this code. When you type /kill (playername), the text doesn't submit through, though the command executes. Along with the error, I found a fix. Replace the old /kill code with this. Code: ' Kill player *bows*. I'm so 1337 Re: [MS4] Kill Command - Rian - 18-09-2008 Code: ' Kill player Should work too Re: [MS4] Kill Command - Nean - 18-09-2008 I've never gotten the point of VbNullString, anyone care to explain? Re: [MS4] Kill Command - Rian - 18-09-2008 Ask Lea about the technical stuff. From what I understand though, vbNullString is faster than using "". They also seem completely interchangeable. Re: [MS4] Kill Command - Nean - 18-09-2008 Lea Wrote:vbNullString is a constant provided by VB6 that represents a null (empty) string. I see, thanks. So basically in that code its saying: Mytext = Nothing? Re: [MS4] Kill Command - Jacob - 18-09-2008 This tutorial is out of date now if you are using v3.51. http://web.miragesource.com/forums/viewtopic.php?f=124&t=4353 Code: ' Kill player Re: [MS4] Kill Command - Nean - 22-09-2008 This tutorial is out of date! Lucky for you wankers (hehe), I remade it for the newest version. YAY. =[ Server Under: Code: ' :: Quit game packet :: Add: Code: ' :::::::::::::::::::::::: Then find: Code: HandleKickPlayer Index, Parse Add this under that: Code: Case CkillPlayer Remember, this is just the newest change. The client hasn't changed. Re: [MS4] Kill Command - Jacob - 22-09-2008 Code: Dim N Make sure to give your variables a type. If you don't then they are considered 'Variants' and are very slow. Code: dim n as long Re: [MS4] Kill Command - Nean - 22-09-2008 Dugor Wrote: I see. Thanks for that tip. So whats dimming it as long mean? I mean, I don't understand dimming as certain types. Someone wanna explain that? Like Dim as Val, Boolean, Byte, integer, Etc, Etc. Re: [MS4] Kill Command - Rian - 22-09-2008 http://www.vbtutor.net/lesson5.html |