• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Blog Post] Scripting API blog post discussion
#4
So here's my statement:



I really appreciate the tags that are making appearance in the API. That way we're going to solve many common problems across Scriptwriters. They'll be forced to always provide correct information for the functions. That's a great start.



Another great thing is the naming convention. Sometimes noun "Player" didn't match with the feature that function provided. It's a better approach with underscores. C# OOP has . (dot) sign to follow up its members, C has its pointers and we will have underscores. The only matter of thing I have on my mind is to create open.mp syntax and make it downloadable in VS Code extensions store. So all the function names, parameters are going to be automatically provided while typing (as suggestions).



So that's a first suggestion I have: open.mp API syntax and suggestions gathering via VS Code extensions.



Another good thing about what you do is using boolean parameter for displaying an entity. It's better to pass that by param. instead of doing `if-else` condition since you can implement that condition in parameter.



I mean that example:

Code:
if (var) Checkpoint_Show(cpid, playerid);

else Checkpoint_Hide(cpid, playerid);



If possible, make all new functions appear the way as:



Code:
X_Toggle/Display(entity, forEntity, bool:display)



One thing that always bothered me is variable names and parameter names in pawn language. But that's probably because I'm used to C# too much. I always specify my variables as " playerId " instead of " playerid " - but that's a minor issue (and a personal one more rather).



---

Code:
// Just get `z`.

z = Player_GetRotation(playerid);



That's a great thing! It's so simple yet so useful! Can't remember how many times I was so annoyed by having getting all x, y, z to simply just get z of player's position OR facing angle. Good! And also retrieving the value by returning it from the function and not passing it by reference is also great thing. Thanks for that.



About your issue with invalid IDs returning.. I never liked that SA-MP's functions returned `1` as first valid objectId (from CreateObject), vehicleId (from CreateVehicle) etc. Valid items ID should always start from `0` and invalid one should return `-1`.



I'm happy to see everything is progressing, I'm just waiting for the initial release. I'm planning on migrating my The Last of Us (SA-MP) Project and call it The Last of Us (open.mp) Project for once... I will make an official live-stream migration process of the gamemode I have created (once open.mp is ready server-wise).



Another thing I really want to see in open.mp is provided features of:



- streamer plugin

- YSF

- and maybe some other (?)



internally. Basically server-sided plugins could be easily managed by default and provided in the package already instead of having to download dependencies separately (but then, what's the point of sampctl right?).



Anyway. Waiting for more, I wanna script in open.mp API already and try migrating my project.
[Image: widget.png?style=banner2]


  Reply


Messages In This Thread
Scripting API blog post discussion - by Y_Less - 2020-04-14, 07:00 PM
RE: API blog post discussion - by dreftas - 2020-04-14, 09:47 PM
RE: API blog post discussion - by Polygon - 2020-04-15, 12:24 AM
RE: API blog post discussion - by Riddick - 2020-04-15, 08:25 AM
RE: Scripting API blog post discussion - by Josh - 2021-01-07, 04:44 PM

Forum Jump: