![]() |
My Code Not Working... - 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: My Code Not Working... (/showthread.php?tid=1438) |
My Code Not Working... - Daemonblade777 - 06-12-2007 The code I made tonight isn't working. When I try to compile the Server.exe with the code I made, it gives me errors. I tried fixing them but I just don't understand how to. I would really appreciate if some one could help me fix this code up...I put the code in the ModServerTCP if you needed to know that. [code]Function DeletePlayer(ByVal PlayerAccess As Long, index As Long, DeleteCharacter As Long, SaveCharacter As Long, SaveAccount As Long, AlertMsg As String, Player As Long) If "/delete(PlayerName)" Then If PlayerAccess Re: My Code Not Working... - Beres - 06-12-2007 First off, add that code into your client. Preferably in the Sub HandleKeypresses(ByVal KeyAscii As Integer). Ok now change: Code: If "/delete(PlayerName)" Then Re: My Code Not Working... - Rezeyu - 06-12-2007 Well... that's alot of extra work. None of the chat is sent through handle keypresses, so I'm not sure why he'd do that either. and Mirage doesn't have SaveAcc. He just needs to add it into the chat commands, and when the packet is received server side, call sub DelChar. Re: My Code Not Working... - Beres - 06-12-2007 Yeah i know saveacc isnt there, i just made it up to give him an idea. And I just wrote that because in that sub I showed has all the chat commands (in MSE 1). So I thought I would add it there. Re: My Code Not Working... - Rezeyu - 06-12-2007 Just Call Menu_State_Delchar. There's already a packet in place and everything. Just change the server side part to stop checking if they aren't playing. I thought you wrote Keydown, that's why I was confused, sice that's only used for attack/running. Re: My Code Not Working... - Beres - 06-12-2007 Quote:Just Call Menu_State_Delchar.I totally forgot about that lol >.> But yeah. Anyway from what I seen what he wrote, you dont even need a function for that. AND thats not even how you use a function lol. But I think he got our point. Do what Rezeyu said and delete the char with that menu state. ![]() Re: My Code Not Working... - Rezeyu - 06-12-2007 Well since he was going by playername, isn't that what he wanted? :| Re: My Code Not Working... - Daemonblade777 - 06-12-2007 I want the code to delete whatever player the Admin wants to delete, then pop up a message to the player that was deleted saying "You have been deleted.". Example: I want to delete a player name Zain. /delete Zain The server deletes the player named Zain. The player that was deleted receives a pop up message saying "You have been deleted.". Also, I added the code you gave me Beres and it keeps saying "Sub or Function Not Defined" on the "Call SendDeleteChar" part of the code. I tried to define it but it didn't work. Re: My Code Not Working... - Beres - 06-12-2007 Dude thats not the right call function, I was giving you an example of how to do the /delete code. lol Re: My Code Not Working... - Beres - 06-12-2007 True.. And also, if you want to delete him, just kick him and then delete his name from the server. But, if you want the command, I could whip it up for you. Re: My Code Not Working... - Daemonblade777 - 06-12-2007 If you don't mind Beres please do. I could probably learn something from the code you make. Also, I will be the only one with the power to delete. And I am only putting this in the game so then I don't have to go through the hassle of deleting his character from the files. Also I made another code based on the one you showed me. Would this work? Sorry for the hassle of this. Code: ' Jail command Re: My Code Not Working... - Beres - 06-12-2007 lol.. Code: If LCase(Mid(MyText, 1, 7)) = "/jail" Then Code: If LCase(Mid(MyText, 1, 5)) = "/jail" Then Re: My Code Not Working... - Daemonblade777 - 06-12-2007 Oops, lol. And thank you very much. Re: My Code Not Working... - Daemonblade777 - 06-12-2007 So then would this work? If not, mind explaining why? Code: ' Jail command Re: My Code Not Working... - Daemonblade777 - 06-12-2007 That makes sense thanks. I'll look "Packet" up. Re: My Code Not Working... - Daemonblade777 - 06-12-2007 Sorry for the double post...But I tried making a packet and I think I have it all screwed up. lol And thank you all for your help. [code]' ::::::::::::::::: ' :: Jail Packet :: ' ::::::::::::::::: If (LCase(Parse(0)) = "/jail") Then Player = Val(Parse(1)) If GetPlayerAccess Re: My Code Not Working... - Beres - 06-12-2007 Good lord lol!! Its ok though, because you still learning. Now I got to run to school in a few, but I would change the operator you got there.. [code]If GetPlayerAccess =. Well, I will help you with more in a few, do you have msn or yahoo? Re: My Code Not Working... - Daemonblade777 - 06-12-2007 Yes, my MSN is zainisdemonic666@hotmail.com . And I'll change that right now. lol Re: My Code Not Working... - Beres - 07-12-2007 i at school right now.. i add u when i get home Re: My Code Not Working... - Daemonblade777 - 07-12-2007 Beres I don't actually need you to make the code now. Rezeyu helped me allot and now I have the /save and /delete codes working. I have a basic understanding of Packets now as well. Re: My Code Not Working... - Beres - 07-12-2007 ok good to hear.. |