SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Plugin Development

Reply
 
Thread Tools Display Modes
Old 18/02/2019, 02:47 PM   #391
ikkentim
High-roller
 
ikkentim's Avatar
 
Join Date: Jan 2010
Location: Kampen, The Netherlands
Posts: 1,047
Reputation: 205
Default Re: SampSharp - Write gamemodes in .NET

Please note you need the 32 bit version of .net core (since samp is 32 bit). VS probably installed 64 bits.
__________________
Greetings,
Tim Potze

Projects
GAMEDEV | Part-time developer working on Parkitect. | Steampage
LSRES | A SA:MP server from the past, and hopefully, back in the future.
SampSharp | Plugin for writing SA:MP gamemodes in C#. | Topic Website Github
SanMap | San Andreas in G00GLE MAPS! | Topic Github Sample
ikkentim is offline   Reply With Quote
Old 19/02/2019, 12:47 AM   #392
RenanMsV
Big Clucker
 
Join Date: May 2016
Posts: 190
Reputation: 6
Default Re: SampSharp - Write gamemodes in .NET

Its me again. Sorry.
But how to I show a Dialog ? or a Textdraw? theres no info in the docs about it.

Edit found it for dialog:
Still figuring out how to handle the response.

Edit2 got it working, is this the right way?

PHP Code:
    [Command("help",Shortcut "h")]
    public static 
bool help(BasePlayer _sender)
    {
        
_sender.SendClientMessage("Opening help dialog");
        
MessageDialog diag = new MessageDialog($"This dialog caption with your name: {_sender.Name}""This info Line 1\nNow its the line2\nThis is a really really really long giga max3turbo string""Accept""Reject");
        
diag.Response += HelpDiagResponse;
        
diag.Show(_sender);
        return 
true;
    }

    private static 
void HelpDiagResponse(object senderDialogResponseEventArgs e)
    {
        
BasePlayer _sender e.Player;
        
_sender.SendClientMessage($"Dialog response: Button: {e.DialogButton} , DialogId: {e.DialogId} , e.Player.Name : {e.Player.Name} , ListItem: {e.ListItem} , InputText: {e.InputText} .");
    } 
This is what i get as response

HTML Code:
Dialog response : Button : Right , DialogId: 10000 , e.Player.Name : MyName , ListItem: -1 , InputText

------

Another question, when the user miss an argument to the command it will show him an error message "Usage /kick [player]", but what if i want to change the language of this error message?
__________________


Free SAMP Server Hosting (20 slots) or Hosted Tab: http://ultra-h.com

Last edited by RenanMsV; 19/02/2019 at 01:41 AM.
RenanMsV is offline   Reply With Quote
Old 24/02/2019, 12:29 AM   #393
RenanMsV
Big Clucker
 
Join Date: May 2016
Posts: 190
Reputation: 6
Default Re: SampSharp - Write gamemodes in .NET

Here is the Bare gamemode from Samp ported to SampSharp 0.8 if anyone want to use as a starting point. https://github.com/RenanMsV/SampSharp-bare
__________________


Free SAMP Server Hosting (20 slots) or Hosted Tab: http://ultra-h.com
RenanMsV is offline   Reply With Quote
Old 24/02/2019, 12:31 PM   #394
ikkentim
High-roller
 
ikkentim's Avatar
 
Join Date: Jan 2010
Location: Kampen, The Netherlands
Posts: 1,047
Reputation: 205
Default Re: SampSharp - Write gamemodes in .NET

Quote:
Originally Posted by RenanMsV View Post
Another question, when the user miss an argument to the command it will show him an error message "Usage /kick [player]", but what if i want to change the language of this error message?
You might want to join the Slack chat if you want some quicker responses

In the command attribute you can specify the UsageMessage
__________________
Greetings,
Tim Potze

Projects
GAMEDEV | Part-time developer working on Parkitect. | Steampage
LSRES | A SA:MP server from the past, and hopefully, back in the future.
SampSharp | Plugin for writing SA:MP gamemodes in C#. | Topic Website Github
SanMap | San Andreas in G00GLE MAPS! | Topic Github Sample
ikkentim is offline   Reply With Quote
Old 28/02/2019, 05:31 AM   #395
m3shys
Big Clucker
 
m3shys's Avatar
 
Join Date: Jul 2014
Posts: 76
Reputation: 23
Default Re: SampSharp - Write gamemodes in .NET

What's the performance hit from this? also can you update main-thread to include that information?
m3shys is offline   Reply With Quote
Old 28/02/2019, 03:21 PM   #396
ikkentim
High-roller
 
ikkentim's Avatar
 
Join Date: Jan 2010
Location: Kampen, The Netherlands
Posts: 1,047
Reputation: 205
Default Re: SampSharp - Write gamemodes in .NET

The performance according to my last bench was better than Pawn. I don’t know what you mean with your second wuestion, sorry.

I’ll try and create some benchmarking scripts for new benchmarks soon.
__________________
Greetings,
Tim Potze

Projects
GAMEDEV | Part-time developer working on Parkitect. | Steampage
LSRES | A SA:MP server from the past, and hopefully, back in the future.
SampSharp | Plugin for writing SA:MP gamemodes in C#. | Topic Website Github
SanMap | San Andreas in G00GLE MAPS! | Topic Github Sample
ikkentim is offline   Reply With Quote
Old 01/03/2019, 12:35 AM   #397
Crayder
Banned
 
Join Date: Sep 2013
Location: Flames of Hell
Posts: 3,331
Reputation: 652
Default Re: SampSharp - Write gamemodes in .NET

I can't seem to figure this out again... My old version works fine still but when I try to make a new server I have absolutely no luck. I've even tried using the grandlarc example, it doesn't actually load the gamemode. The plugin loads fine and the blank gamemode is loading as well as the two filterscripts. Not sure what I'm doing wrong... :thinking:

EDIT: Like, not even TestMode in the SampSharp solution is running the actual gamemode. The mode is generated, but never seems to give any output when running the server.

Last edited by Crayder; 01/03/2019 at 03:13 AM.
Crayder is offline   Reply With Quote
Old 01/03/2019, 09:09 AM   #398
Banditul18
Huge Clucker
 
Join Date: Nov 2014
Location: Brasov,Romania
Posts: 392
Reputation: 32
Default Re: SampSharp - Write gamemodes in .NET

Can you show the server.cfg/serverlog?
This is what i made(not the best or good thing): https://github.com/Banditul/SAMP-BasicGamemode
But should give a somekind of example
Banditul18 is offline   Reply With Quote
Old 01/03/2019, 07:01 PM   #399
Crayder
Banned
 
Join Date: Sep 2013
Location: Flames of Hell
Posts: 3,331
Reputation: 652
Default Re: SampSharp - Write gamemodes in .NET

Quote:
Originally Posted by Banditul18 View Post
Can you show the server.cfg/serverlog?
This is what i made(not the best or good thing): https://github.com/Banditul/SAMP-BasicGamemode
But should give a somekind of example
log:
Code:
----------
Loaded log file: "server_log.txt".
----------

SA-MP Dedicated Server
----------------------
v0.3.DL-R1, (C)2005-2018 SA-MP Team

[22:15:09] 
[22:15:09] Server Plugins
[22:15:09] --------------
[22:15:09]  Loading plugin: SampSharp
[22:15:09]   Loaded.
[22:15:09]  Loaded 1 plugins.

[22:15:09] 
[22:15:09] Filterscripts
[22:15:09] ---------------
[22:15:09]   Loaded 0 filterscripts.

[22:15:09]   Filterscript 'empty.amx' loaded.
[22:15:09] 
[22:15:09] SampSharp Plugin
[22:15:09] ----------------
[22:15:09] v0.8.0-alpha10, (C)2014-2018 Tim Potze
[22:15:09] 
[22:15:09]   Filterscript 'intermission.amx' loaded.
[22:15:09] [SampSharp:INFO] Creating pipe \\.\pipe\SampSharp...
[22:15:09] [SampSharp:INFO] Pipe created.
[22:15:09] Number of vehicle models: 0
[22:17:13] [connection] incoming connection: 127.0.0.1:65163 id: 0
[22:17:13] [join] Crayder has joined the server (0:127.0.0.1)
[22:38:23] [part] Crayder has left the server (0:1)
cfg:
Code:
rcon_password mysecurepassword
hostname SA-MP 0.3 Server
gamemode0 empty 1
logtimeformat [%H:%M:%S]
language English
plugins SampSharp
I'm going to take a look at yours though, is it SampSharp 0.8.0?
Crayder is offline   Reply With Quote
Old 01/03/2019, 07:18 PM   #400
Banditul18
Huge Clucker
 
Join Date: Nov 2014
Location: Brasov,Romania
Posts: 392
Reputation: 32
Default Re: SampSharp - Write gamemodes in .NET

Yes. Its 0.8.0 (or atleast beta 10)
You need the net core runtime: https://github.com/ikkentim/SampSharp/issues/298 as far i see
Banditul18 is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Write on the map hejsan123 Scripting Help 3 23/09/2012 09:35 AM
How to write something in a VAR? Ihsan_Cingisiz Help Archive 4 29/05/2010 08:24 PM
How Do You Write This? sidhu123 Everything and Nothing 2 12/09/2009 05:05 AM
Write something in big and to the top TimBuk.Ekh Help Archive 3 18/04/2009 08:19 PM


All times are GMT. The time now is 12:31 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.