These are chat archives for ikkentim/SampSharp

13th
May 2016
Tim Potze
@ikkentim
May 13 2016 10:57
Tried the start/stop yet? :)
@fvandillen
Florian van Dillen
@fvandillen
May 13 2016 10:58
Not yet, working on some economy scripts during college :D
Will try once home
Tim Potze
@ikkentim
May 13 2016 10:59
alright :)
Florian van Dillen
@fvandillen
May 13 2016 11:06
Tim Potze
@ikkentim
May 13 2016 11:06
Nice
Florian van Dillen
@fvandillen
May 13 2016 11:08
Love how all this stuff is way easier with C# as opposed to pawn
The API that all other code works with is so much cleaner
Tim Potze
@ikkentim
May 13 2016 11:20
Yea you don’t got polluted 10k lines files in c#
Florian van Dillen
@fvandillen
May 13 2016 11:20
Lol, I love how some guys on SA:MP forums advertise that as a measure of quality
Z0mg my skript contain 200k lines it's veri gud!!!
Tim Potze
@ikkentim
May 13 2016 11:21
:joy:
Florian van Dillen
@fvandillen
May 13 2016 11:25
I just barely passed 2.6k lines and yet I have all the basics ready, including the group system
Florians-MacBook-Pro-2:RockStars6 florianvandillen$ git ls-files | grep "\.cs$" | xargs wc -l
      68 samp/RockStars6/RockStars6/Database.cs
      64 samp/RockStars6/RockStars6/GameMode.cs
     114 samp/RockStars6/RockStars6/Player.cs
      27 samp/RockStars6/RockStars6/Properties/AssemblyInfo.cs
      25 samp/RockStars6/RockStars6/RS6Accounts/Account.cs
      26 samp/RockStars6/RockStars6/RS6Accounts/DatabaseMapping.cs
     178 samp/RockStars6/RockStars6/RS6Accounts/LoginController.cs
      50 samp/RockStars6/RockStars6/RS6Accounts/PlayerController.cs
     115 samp/RockStars6/RockStars6/RS6Economy/BankAccount.cs
    1095 samp/RockStars6/RockStars6/RS6Groups/Commands.cs
     114 samp/RockStars6/RockStars6/RS6Groups/DatabaseMapping.cs
      34 samp/RockStars6/RockStars6/RS6Groups/Group.cs
      10 samp/RockStars6/RockStars6/RS6Groups/GroupInvitation.cs
      14 samp/RockStars6/RockStars6/RS6Groups/GroupMember.cs
      14 samp/RockStars6/RockStars6/RS6Groups/GroupPermission.cs
      14 samp/RockStars6/RockStars6/RS6Groups/GroupRank.cs
       8 samp/RockStars6/RockStars6/RS6Groups/GroupSpecialPermission.cs
     290 samp/RockStars6/RockStars6/RS6Groups/Groups.cs
     123 samp/RockStars6/RockStars6/RS6Interface/NotificationController.cs
      15 samp/RockStars6/RockStars6/RS6Interface/NotificationElement.cs
      76 samp/RockStars6/RockStars6/RS6Interface/Speedometer.cs
      94 samp/RockStars6/RockStars6/RS6Interface/SpeedometerController.cs
      74 samp/RockStars6/RockStars6/RS6World/DWATS.cs
    2642 total
Oh, you might be interested in my Notification system by the way
Tim Potze
@ikkentim
May 13 2016 11:27
:O How zomg gud size is your pwn sckripd?
Yea I’d be interested :D
Florian van Dillen
@fvandillen
May 13 2016 11:27
It uses a list per player. Once you send notification while one is already being displayed, it stacks
Tim Potze
@ikkentim
May 13 2016 11:27
Ah yea, and then displays it in textdraws?
Florian van Dillen
@fvandillen
May 13 2016 11:27
After 10 seconds of displaying, the one displayed is removed from the list and the next one is shown until the list is empty
Yes
Tim Potze
@ikkentim
May 13 2016 11:28
I’m planning, once i finally get started with my gamemode, to make things in packages (for example notifications) so others can use those packages as well
Florian van Dillen
@fvandillen
May 13 2016 11:28
Sweet!
The NotificationElement is simply a class that contains the Header and Body text of each notification
Tim Potze
@ikkentim
May 13 2016 11:28
:)
Florian van Dillen
@fvandillen
May 13 2016 11:29
I attach the NotificationController to each player that logs in, so it becomes player.NotificationController.Send(header, body)
Florian van Dillen
@fvandillen
May 13 2016 11:36
Would it be possible to call a function via reflection just by knowing the name of that function?
Use-case: I will define different items in my database.
Ingame command for the usage of the items will be /use [item name]
For the item, I will have a database field with the function name to execute when the item is used.
Tim Potze
@ikkentim
May 13 2016 11:37
Yes you can but know it’s a security risk
Florian van Dillen
@fvandillen
May 13 2016 11:37
Security risk in case of player input?
Tim Potze
@ikkentim
May 13 2016 11:37
yea
Florian van Dillen
@fvandillen
May 13 2016 11:37
There won't be player input
The function names are only put in by developers in the database.
Tim Potze
@ikkentim
May 13 2016 11:37
ah okay
Florian van Dillen
@fvandillen
May 13 2016 11:37
We simply define which function will handle which item.
So like item weed will have function UseDrugs
Tim Potze
@ikkentim
May 13 2016 11:38
Google for c# reflection invoke method
Florian van Dillen
@fvandillen
May 13 2016 11:38
thx :)
Tim Potze
@ikkentim
May 13 2016 11:38
typeof(TYPE).GetMethod(name).Invoke(target, new[]{ARGS}); probably
Florian van Dillen
@fvandillen
May 13 2016 11:39
That looks reasonably easy
I'll just make sure the usage functions are inside my items namespace/class