![]() |
Warn system - 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: Warn system (/showthread.php?tid=2278) |
Warn system - Nean - 21-10-2008 So, I know how to make a warning system out of getvars and putvars, however, without INI files, how would I do this? With Elysium's, sadscripting, it's easy enough. Anyone care to post a short example, or possibly explain it? Like I said, i think I could do it with putvars and getvars from an .ini file.... Re: Warn system - Nean - 21-10-2008 Lea Wrote:getvar and putvar write to ini files, so if you dont want to use ini files you wont be using those functions. Gah. You're right. It's just that in Elysium, all the chars are stored in an .ini file, so that it's easy to make a warn system. So how would I make one, without the getvar and putvar? Re: Warn system - Rian - 21-10-2008 Use these functions to Set and Retrieve a players warning level. Code: Function GetPlayerWarning(ByVal Index As Long) As Long Use a text command or something client side to warn a player. The server side packet should have something like: Code: Call SetPlayerWarning(Index, GetPlayerWarning(Index) + 1) Then after that you could use a select case: Code: Select Case GetPlayerWarning(Index) Don't forget to add the proper checks to the packet making sure the player giving the warning is an admin. Re: Warn system - Nean - 21-10-2008 Sonire Wrote:Use these functions to Set and Retrieve a players warning level. Awesome thanks. I'll start working on this tomorrow, and see what I can do. Re: Warn system - Nean - 21-10-2008 I have everything done server side, except for the select case. Where would I put the select case in? Re: Warn system - deathknight - 21-10-2008 If i added something like this, I'd need to delete my account and remake it so it would have a .warning in the account, correct? Is there any way around this? Code: Code: Select all Re: Warn system - Forte - 21-10-2008 you'd either have to delete accounts and remake them, or go into the ini and manually put in the 'warning = ' Re: Warn system - deathknight - 21-10-2008 Well, the big problem for me is I plan on using MS4 (eventually) so I'm trying to build the codes now so I can switch it over to the final version, whatever it happens to be, that I decide to use for my game, and MS4 saves in a .bin format. I'm clueless at how I'd make an editor. I could probably figure out how to edit it myself if i had the source for an editor for a vanilla MS4, but I doubt anyone has that or would be willing to get it. So I figured it may be easier (if possible) to and an if statement on the sub that logs in the player to check to see if a certain part is in there, and if not add it. I haven't studied to much into the binary system, so I wouldn't know how to add this at all. Re: Warn system - Nean - 21-10-2008 I now have Server and Client side done, but no Select Case. Still dunno where to put it. :|, should I put that in the packet itself? Re: Warn system - Rian - 21-10-2008 Well, you don't exactly need the select case, I was just saying that's how I would do it. Pseudo Code Code: Client side: So basically, I was talking about placing the Select Case in the server side packet that handles warning a player. Re: Warn system - Nean - 21-10-2008 Sonire Wrote:Well, you don't exactly need the select case, I was just saying that's how I would do it.Ohhh, I see. Sounds good. Thanks. I'll try it out. ![]() Re: Warn system - Nean - 21-10-2008 Hmmm :/ Method or data member not found Code: Function GetPlayerWarning(ByVal Index As Long) As Long Here's my code: [spoiler]Server Side Code: Function GetPlayerWarning(ByVal Index As Long) As Long Code: Case CWarnPlayer [code]' :::::::::::::::::::::::: ' :: Warn player packet :: ' :::::::::::::::::::::::: Sub HandleWarnPlayer(ByVal Index As Long, ByRef Parse() As String) Dim n As Long ' Prevent hacking If GetPlayerAccess(Index) Re: Warn system - GIAKEN - 21-10-2008 Go to PlayerRec and at the bottom add "Warning As Byte" then you need to delete your accounts. Re: Warn system - Nean - 21-10-2008 RTE 9 on Code: GetPlayerWarning = Player(Index).Char(TempPlayer(Index).CharNum).Warning I'm getting closer... :|. Thanks for bearing with my inability to get anything right ![]() I thought I'd have to add something to the player rec, I added that to both the client and server side Re: Warn system - Nean - 21-10-2008 DFA Wrote:Neon, find all the confirmed bugs on the forum for the latest version of MS4, test em out make sure its actually a bug, then link that thread into Done. =) Re: Warn system - Nean - 22-10-2008 With Giaken's help, I managed to get this working. I'll write a tutorial, when the new MS4 comes out. |