These are chat archives for ikkentim/SampSharp

2nd
Jun 2016
BryanHitchcock
@BryanHitchcock
Jun 02 2016 19:34
Anyone know why messages are still being sent to players when I remove base.OnText(e); inside of the OnText override?
BryanHitchcock
@BryanHitchcock
Jun 02 2016 20:11
I'm having the same issue as well with other functions. For example, I overrode the OnDeath function and removed the base.OnDeath(e); but it's still removing $100 whenever I die.
Florian van Dillen
@fvandillen
Jun 02 2016 20:18
@BryanHitchcock if you want to handle chat messages with a custom handler (which you probably want, you can simply set e.SendToPlayers = false; in your PlayerText-event).
BryanHitchcock
@BryanHitchcock
Jun 02 2016 20:18
@fvandillen Oh alright, thanks!
Florian van Dillen
@fvandillen
Jun 02 2016 20:18
Once disabled, you will still need to send it to your players with whatever handler you come up with.
BryanHitchcock
@BryanHitchcock
Jun 02 2016 20:18
Yes of course. Thank you very much
Florian van Dillen
@fvandillen
Jun 02 2016 20:19
Death, I suggest adding $100 to your player on Death, and then using prevent spawn before letting them spawn, in case you want to let them choose their spawn location.
BryanHitchcock
@BryanHitchcock
Jun 02 2016 20:20
Yeah I did that to fix the death issue, was just wondering if there was a better way. Thank you very much for the help
Florian van Dillen
@fvandillen
Jun 02 2016 20:20
Always welcome mate
BryanHitchcock
@BryanHitchcock
Jun 02 2016 20:20
Also, what Timer do you recommend using? I currently am using System.Timers.Timer
Or should I use the SampSharp Timer class?
Florian van Dillen
@fvandillen
Jun 02 2016 20:20
I am using that too, because I simply prefer the native way.
HOWEVER
I have found an issue when using the timers for repeating tasks (in my case, one task every 2500ms). Mono seems to have an issue with cleaning up the threaded timers.
Still not entirely done with debugging that.
SampSharp timer class should have no issues with your gamemode.
BryanHitchcock
@BryanHitchcock
Jun 02 2016 20:22
Alright, thanks for the heads up. I currently have two timers, but I haven't experienced any issues yet (1000ms and 60000ms)
This message was deleted
Florian van Dillen
@fvandillen
Jun 02 2016 20:23
Yeah, two timers shouldn't give you any issues.
BryanHitchcock
@BryanHitchcock
Jun 02 2016 20:23
They repeat though
Florian van Dillen
@fvandillen
Jun 02 2016 20:23
However I suspect it may have something to-do with the functions I'm calling from those timers (they change time in the server).
BryanHitchcock
@BryanHitchcock
Jun 02 2016 20:24
Ah, yeah I haven't been experiencing any issues. I'll let you know if that changes.
@fvandillen Also, is there anyway to prevent the library from changing the Skin after death without modifying the source of the library?
I'm making a RP game mode from scratch, so I'd like for the skin to not change unless I set it to a new ID
BryanHitchcock
@BryanHitchcock
Jun 02 2016 20:31
@fvandillen Also, whenever I set a value to the Health property in my class that inherited from GtaPlayer, it remains 0 (my health bar in game though is set at 100 on spawn)
Armour is working though
BryanHitchcock
@BryanHitchcock
Jun 02 2016 20:47
Hmm, it seems to work if I set it after I spawn.
But Armour lets me set it at any time... weird.
Tim Potze
@ikkentim
Jun 02 2016 21:11
@BryanHitchcock use http://api.sampsharp.timpotze.nl/html/a553c730-3e03-a520-b730-47042bcd2eb0.htm to set the skin for every future spawn