Daemonblade777
Unregistered
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
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
If PlayerAccess 7 Then
MyText = Mid(MyText, 9, Len(MyText) - 7)
Call SendDeleteChar(MyText)
Call SendSaveChar(MyText)
Call SendSaveAcc(MyText)
End If
MyText = ""
Exit Sub
End If
Then of course the Call Send stuff is what you need to code in. They will obviously send a packet to the server with the players name and then have the server delete the player. I just came out with that code on the top my head, so let me know whats up.
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.
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.
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.
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.
Well since he was going by playername, isn't that what he wanted?
:|
Daemonblade777
Unregistered
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.
Dude thats not the right call function, I was giving you an example of how to do the /delete code. lol
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.
Daemonblade777
Unregistered
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
If LCase(Mid(MyText, 1, 7)) = "/jail" Then
If Len(MyText) > 7 Then
MyText = Mid(MyText, 9, Len(MyText) - 7)
Call SetPlayerMap(Index, 100)
Call SetPlayerX(Index, 10)
Call SetPlayerY(Index, 12)
Call Msg(Index, "You have been put into Jail.", 1)
Call GlobalMsg(Index, "(PlayerName) has been sent to jail.")
End If
MyText = ""
Exit Sub
End If
lol..
Code: If LCase(Mid(MyText, 1, 7)) = "/jail" Then
Count the amount of characters of /jail. Its 5.. So change it to
Code: If LCase(Mid(MyText, 1, 5)) = "/jail" Then
Anyway, I will write you the code for this in a few, when I get back..
Daemonblade777
Unregistered
Oops, lol. And thank you very much.
Daemonblade777
Unregistered
So then would this work? If not, mind explaining why?
Code: ' Jail command
If LCase(Mid(MyText, 1, 7)) = "/jail" Then
If Len(MyText) > 7 Then
MyText = Mid(MyText, 9, Len(MyText) - 7)
Call SendPlayerMap(Index, 100)
Call SendPlayerX(Index, 10)
Call SendPlayerY(Index, 12)
Call Msg(Index, "You have been put into Jail.", 1)
Call GlobalMsg(Index, "(PlayerName) has been sent to jail.")
End If
MyText = ""
Exit Sub
End If
Daemonblade777
Unregistered
That makes sense thanks. I'll look "Packet" up.
Daemonblade777
Unregistered
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
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?
Daemonblade777
Unregistered
Yes, my MSN is zainisdemonic666@hotmail.com . And I'll change that right now. lol
i at school right now.. i add u when i get home
Daemonblade777
Unregistered
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.
|