SA-MP Forums

SA-MP Forums (https://forum.sa-mp.com/index.php)
-   Tools and Files (https://forum.sa-mp.com/forumdisplay.php?f=82)
-   -   [Tool/Web/Other] PAWN Fiddle - Share & run PAWN code online (https://forum.sa-mp.com/showthread.php?t=665358)

Peek 31/03/2019 10:35 PM

PAWN Fiddle - Share & run PAWN code online
 
PAWN Fiddle
Share & run PAWN code

PAWN Fiddle is a playground platform for the PAWN scripting language. Create, execute, fork and share code snippets across the SA-MP community.

What is this for?
If you need help with your code, you can use this fiddle service instead of posting big code blocks in the forum or discord which isn't really testable. With PAWN Fiddle you can send a complete example of your problem, which makes it easier for the other person to fix your code / help you with the integrated compiler and plugin / include support. This could also be used to demonstrate the use of your plugin / include (provided it's a sampctl-compatible PAWN-package), or snippet hosting.

How do I use this?
  1. Navigate to https://fiddle.sa-mp.dev
  2. Select the dependencies your fiddle needs.
    https://i.imgur.com/KyfSbp1.png
  3. Write / Paste your code.
    https://i.imgur.com/bVGk19t.png
  4. Check if your code compiles, by clicking the Run button.
    https://i.imgur.com/IwHFRNg.png
  5. Share your fiddle with the world.
    https://i.imgur.com/iJrwzz8.png

Liveserver (Beta)
https://fiddle.sa-mp.dev

GitHub (Source Code)
https://github.com/samp-dev/fiddle

Despare 01/04/2019 12:44 AM

Re: PAWN Fiddle - Share & run PAWN code online
 
Great tool! very good !

hotspicytaco 01/04/2019 01:20 AM

Re: PAWN Fiddle - Share & run PAWN code online
 
Finally! Thank you!

Freaksken 01/04/2019 02:18 AM

Re: PAWN Fiddle - Share & run PAWN code online
 
Really, really like the idea!

RenanMsV 01/04/2019 07:37 PM

Re: PAWN Fiddle - Share & run PAWN code online
 
pawn Code:
#include <a_samp>

main(){}
Code:

[ FATAL ] Line 1: cannot read from file: "a_samp"

Crayder 01/04/2019 08:58 PM

Re: PAWN Fiddle - Share & run PAWN code online
 
Considering it literally uses a SA-MP server instead of a separate PAWN implementation, this isn't a "PAWN Fiddler." It's a SA-MP Gamemode Fiddler.

Also, can't include a_samp.

DAKYSKYE 01/04/2019 09:05 PM

Re: PAWN Fiddle - Share & run PAWN code online
 
Quote:

Originally Posted by RenanMsV (Post 4091686)
pawn Code:
#include <a_samp>

main(){}
Code:

[ FATAL ] Line 1: cannot read from file: "a_samp"

first of all you need to get sampctl/samp-stdlib library.

RenanMsV 01/04/2019 09:13 PM

Re: PAWN Fiddle - Share & run PAWN code online
 
Quote:

Originally Posted by DAKYSKYE (Post 4091698)
first of all you need to get sampctl/samp-stdlib library.

This works :D

Peek 01/04/2019 11:37 PM

Re: PAWN Fiddle - Share & run PAWN code online
 
Quote:

Originally Posted by ****** (Post 4091591)
1) The domain implies a far more official status than this really has. You should add a note that this is in no way endorsed or associated with SA:MP.

That was not my intention. I added a non-affiliation disclaimer on the mainpage (sa-mp.dev).

Quote:

Originally Posted by ****** (Post 4091591)
2) The list of dependencies seems to shuffle constantly, and is almost unusable for browsing in its current state. It should at least be alphabetical.

Fixed in cdb8512

Quote:

Originally Posted by ****** (Post 4091591)
3) The "Run"/"Stop" button doesn't detect when the server shuts down normally, thus ending the script.

The "Stop" button is displayed until the max. execution time is reached or the sampctl process dies.

Quote:

Originally Posted by ****** (Post 4091591)
4) You can't type any commands in to the server once running.

Do you mean RCON commands? Would this be useful?

Quote:

Originally Posted by ****** (Post 4091591)
5) Tab indentation doesn't use tabs.

I guess indentation using space became more popular. This is a default setting of the Monaco-Editor.

Quote:

Originally Posted by ****** (Post 4091591)
6) The auto-complete is nice, but doesn't parse the added includes, so doens't really help much.

This is also a standard feature of the Monaco-Editor. I'll see if I can possibly add autocompletion for natives.

Quote:

Originally Posted by ****** (Post 4091591)
7) The icons on the nested dependencies look like they can be downloaded.

Fixed in ed689fd

Quote:

Originally Posted by ****** (Post 4091591)
8) It is very offputting from using the tool at all when the footer has an emoji in it.

Edit: It was extremely ironic that the forums replaced `8)` with an emoji...

In my opinion an emoji shouldn't be "offputting" from using a tool, especially in a gaming community.

Quote:

Originally Posted by ****** (Post 4091591)
9) Refreshing the page momentarily flashes an error about the backend connection being lost.

Fixed in f16e50e

Quote:

Originally Posted by ****** (Post 4091591)
10) samp-stdlib isn't implicitly imported, despite `<a_samp>` being automatically included.

Added in e80bb03

Quote:

Originally Posted by ****** (Post 4091591)
11) The default code should probably also include `main()`, since that's required by the server.

Added in 43ff82b

Quote:

Originally Posted by ****** (Post 4091614)
Can you clarify exactly what "fork" is doing? That's a GitHub term, which copies the whole of a repository (or in this case post) to your account once. The closest analogy in pure Git would be either cloning or branching, but neither has a one time limit, and I didn't log in to GitHub, so I'm not sure where it is being forked to.

Also, the behaviour without a "fork" is a little annoying, since you can't edit anything. Every other fiddle service allows you to instantly start editing existing code. It doesn't save to the original link, but creates a new one when clicking save. In fact, that would do away with the need for the confusing terminology entirely.

The fork button creates a new identical fiddle, that's all it does.

I really appreciate your extensive feedback. If you have further feature requests or improvements, please open an issue on GitHub.

Crayder 02/04/2019 04:17 AM

Re: PAWN Fiddle - Share & run PAWN code online
 
In recap of my previous comment, I have nothing against this being a Gamemode Fiddler. I just think that name is better in this case. In fact I prefer the idea of having the option to run a SA-MP Gamemode online.

Perhaps you could make some fiddler plugin that allows access to scriptfiles within the site, downloading and viewing them as well. For example what if my fiddler code used y_bitmap to produce a .bmp file that I would like to see, that option would be amazing.


All times are GMT. The time now is 10:46 AM.

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