Welcome, Guest
You have to register before you can post on our site.

Username
  

Password
  





Search Forums



(Advanced Search)

Forum Statistics
» Members: 6,505
» Latest member: lucasmillerfeb2022
» Forum threads: 2,233
» Forum posts: 12,033

Full Statistics

Online Users
There are currently 539 online users.
» 0 Member(s) | 536 Guest(s)
Bing, Google, Yandex

Latest Threads
Command does not work in-...
Forum: Pawn Scripting
Last Post: PANZEHIR_
7 hours ago
» Replies: 0
» Views: 20
White Screen
Forum: Support
Last Post: Phat202146_real
2024-11-21, 02:50 PM
» Replies: 0
» Views: 28
I get error 021 using y_h...
Forum: Pawn Scripting
Last Post: daniscript18
2024-11-18, 11:34 PM
» Replies: 0
» Views: 49
Il reste des français sur...
Forum: French/Fran?ais
Last Post: tysanio
2024-11-18, 05:39 AM
» Replies: 2
» Views: 449
Object creation issues
Forum: Programming
Last Post: K1271
2024-11-15, 11:51 PM
» Replies: 0
» Views: 48
Is the SAMP Hosting the s...
Forum: General Discussions
Last Post: OperaGX
2024-11-14, 09:33 PM
» Replies: 0
» Views: 63
Run time error 19: "File ...
Forum: Pawn Scripting
Last Post: Rexey
2024-11-14, 03:50 AM
» Replies: 0
» Views: 59
How to Compile Your Gamem...
Forum: Tutorials
Last Post: thelante
2024-11-13, 08:50 AM
» Replies: 3
» Views: 450
Modeller wanted
Forum: Development Updates
Last Post: acc.gangbeni
2024-11-11, 05:10 PM
» Replies: 9
» Views: 16,449
SA:MP forum offline
Forum: Portuguese/Portugu?s
Last Post: weslley_script
2024-11-09, 05:27 PM
» Replies: 7
» Views: 9,898

 
  SA:MP specific objects
Posted by: BloodMaster - 2019-04-20, 02:16 PM - Forum: Questions and Suggestions - Replies (6)

As we know, SA:MP has many objects added that are not in GTA:SA by default.

Will those objects be featured in open.mp.

My guess is that they're copyrighted, so we're gonna have to import them ourselves with our own risk.





Also, maybe just a?thread for small questions would be great! :)


  Yet Another Lua Plugin
Posted by: IllidanS4 - 2019-04-20, 01:57 PM - Forum: Plugins - No Replies






Introduction

This plugin allows you to use Lua, your favourite dynamic flexible scripting language, in SA-MP, for all purposes, be it sandboxing user scripts, debugging the server, or developing filterscripts and gamemodes. YALP provides lightweight and flexible Lua environment that can use existing or future natives from SA-MP or plugins.



The main feature of YALP is a powerful interop API to interact with existing Pawn natives and callbacks. It is very easy to call existing functions, without needing to declare them anywhere:

Code:
interop.native.SetPlayerPos(0, 1235.31, -2331.84, 12.33)

YALP automatically converts all arguments to their proper Pawn cells, and allows you to specify what the function returns in the actuall call. All standard cell and single-dimensional array types are supported.



Callbacks can be specified in a similar simple way:

Code:
function interop.public.OnPlayerConnect(playerid)

? -- ...

end



Thanks to these mechanisms, you can use any framework you want, or build your own in Lua, without depending on new versions of this plugin.



Configuration

There is no special XML, JSON or other configuration of this plugin, because you can specify everything when you create a new Lua state (you can create any number you wish, and run any code inside). You can specify what packages should be loaded or available in the Lua instance, how much maximum memory it should take, or even limit for how long Lua functions can run.



Features

All standard Lua packages are available (although some of the more unsafe ones aren't allowed by default). The powerful interop package can interface with any Pawn native function or callback. There is also an advanced timer library with support for simple asynchronous functions (with Lua coroutines) and all sorts of timers. The remote package contains functions for remote communication between two separate Lua instance (via serialization or proxies).



The standard Lua packages are also enhanced with a couple of useful functions. Please see the wiki for a list of all new functions.



The Pawn API is basically a port of the Lua C API, allowing advanced manipulation of the Lua machine. It is recommended to use the Lua API, since it can do everything that Pawn can do, but if you need to interact with an existing complex Pawn library, it is possible as well.



Sample code

Code:
#include <a_samp>

#include <YALP>



public OnFilterScriptInit()

{

??? new Lua:l = lua_newstate(); // creates a new Lua instance

?? ?

??? if(lua_loadfile(l, "script.lua")) // loads a Lua script and returns an error code

??? {

??????? lua_stackdump(l); // prints the stack for more information about the error

??????? return;

??? }

??? lua_bind(l); // binds the Lua instance to the current Pawn filterscript/gamemode, so all interation with it is rerouted to Lua

??? // if the binding succeeds, this code is not run (and the Lua instance is destroyed if the script is unloaded)

??? lua_stackdump(l);

}

Code:
-- script.lua

local interop = require "interop"

interop.native.print("Hello from Lua!")


  SACNR-samp
Posted by: iSpark - 2019-04-20, 01:32 PM - Forum: Libraries - No Replies

This is a library which provides (for now) one function which returns information about any server present in monitor.sacnr.com



https://github.com/Ronnie-Skylar/sacnr-samp



Further information is present in the repository itself.



Credits

Me

IllidianS4 for pawnplus

GiamPy?


  Vice City Roleplay (vc-rp.es)
Posted by: adri1 - 2019-04-20, 12:43 PM - Forum: Discusi?n GTA SA Multijugador - Replies (26)




[Image: 9aCKrdd.png]



Direcci?n IP: gta.vc-rp.es:5555

Versi?n: 0.3.DL (descargar)

Descarga de m?delos: clic aqu?



[Image: widget.png?style=banner2]






Introduccion

Vice City Roleplay es un servidor ambientado en su totalidad en la ciudad de Vice City con un nivel de rol no estricto.

El servidor ha sido programado sin base por lo que todo es completamente nuevo, sin embargo, se necesitar? tiempo para completarlo.

En el juego los jugadores podr?n obtener todo lo que quieran jugando, no hay ni habr? membresias o compras externas con moneda real. La idea es aumentar la diversi?n.



Introduccion dentro del juego (IG)

[Video: https://www.youtube.com/watch?v=U0GTH5joi2I]





Vice City

?Todo el mapa ha sido trabajado para obtener el mejor rendimiento posible!



[Image: MPVBWYK.png]





Radios de Vice City

?El servidor cuenta con todas las radios de Vice City en tiempo real para todos los usuarios!



[Image: TQkSEAh.png]





Inventario

Este nuevo sistema de inventario har? que todo sea m?s f?cil, desde ?l podr?s abrir tu veh?culo con la llave, comer, beber y todo lo que sea necesario.

Adem?s puedes mover tus objetos de posici?n en el inventario, dar un objeto a otro jugador y eliminarlo.



[Image: uutncA0.png]



Sistema de llaves

Las llaves se dividen en tres tipos: maestras (color oro), duplicadas (color plata) y de renta (color bronce).

Puedes duplicar cualquier llave maestra ya sea de un negocio, propiedad o veh?culo y dar la llave duplicada a otra persona, de esta forma la otra persona tendr? tambi?n acceso.



Veh?culos

Puedes tener un m?ximo de tres veh?culos propios, los puedes comprar en un concesionario.



[Image: 2TlOBwEl.png]



Tambi?n puedes alquilar veh?culos.



[Image: eIovGU6l.jpg]





Propiedades

Hay muchas propiedades por todo Vice City, puedes tener hasta tres a la vez.

Tambi?n puedes alquilar propiedades.



[Image: cfhW7f2l.jpg]





Negocios

Puedes comprar negocios y administrarlos, si te va bi?n podr?s ganas dinero con ellos.



[Image: zqEwLZel.jpg]



Los negocios tienen su caja fuerte y su sistema de gesti?n.



[Image: aIgtt1Pl.png]

Trabajos

En los trabajos puedes conseguir dinero, actualmente hay pocos trabajos pero se ir?n a?adiendo m?s con el tiempo.



[Image: DW90IaL.png]





Otas im?genes



[Image: WJ2sBcKl.png]



[Image: QrRVDq6l.jpg]



[Image: GkNSPTxl.jpg]



[Image: eIGBTYBl.jpg]



[Image: 1b8MObnl.jpg]



[Image: WdAKBSjl.jpg]



[Image: nQkaApel.jpg]



Servidor en fase BETA

El servidor se encuentra en una fase BETA, esto no significa que no se pueda jugar, los progresos no ser?n borrados.

Lo que significa es que el servidor puede contener errores adem?s de falta de contenido, pero no te preocupes ?vamos a estar a?adiendo contenido constantemente!






  Don't make open.mp a "custom engine that you can mod"
Posted by: BloodMaster - 2019-04-20, 10:05 AM - Forum: Questions and Suggestions - Replies (45)

Hey guYzzZzZZzZzZ, modZ and DeveLoPerZZZzzZz

So first of all, great initiative and idea, I really appreciate?that somebody still sees light in a decade old game, and furthermore making it compatible with existing scripts is just insane. I love you.

Now, as it comes with ambition, people tend to get carried away with what they can do and what is possible. But, I would like to remind you that this is "San Andreas", and that, no matter how much I disagree with K***** (Developer of SA:MP), I do agree with some of his fundamental rules that I personally believe made the mod so good and important.

Here's stuff that I agree with:

?-Don't add the ability to remove HUD
Okay okay!! Stop throwing bananas and tomatoes at me, calling me "You're Kyes secret agent that wants to destroy open.mp", and you Josh... Yes you. Please stop biting my leg.
San Andreas' HUD is one of the core branding's for the San Andreas, and I think being able to remove it and make your own custom HUD would ruin the feel of San Andreas and make transitions from server to server more confusing.
Here's what I propose instead; Make it a bit more flexible. What I mean by that, is add that thingy where your max health can increase ( http://prntscr.com/nehsv4 ),?and maybe if you plan on adding custom images, make it so?we can add custom weapon image (but make the black border default?so it doesn't lose shape and doesn't vary much from server to server ).

[i]?-Don't add custom vehicles. At least, not fully.

If you don't want to see 99% of the servers filled with SUPER-FULL-HD BMWS', MERCEDESS' AND AUDIS, you will not make custom vehicles.. Now, people like me, would use that functionality to create more vehicles like the existing ones. Let's say 4 door turismo, or custom trailers for trucks to pull, I would create much better variety of vehicles that fit the San Andreases agenda.
But. I am willing to sacrifice all that just because of the people that would abuse it. There are some solutions I think. For example limiting the amount of polygons for custom models?or make additional vehicles yourself that we could use.

?-Don't make custom skins
Instead, I would prefer being able to add existing skins and re-texturing them. Yes, people would still retexture them to look like teletubbies, but hey, it's better than a full-hd Steve from Minecraft. (Although, that's already kinda possible with AttachObject)

Now that I am done, please put down your pitches and forks and let's have a civil discussion.[/i]


Wink Reconnect plugin for 0.3.DL
Posted by: Wanderer - 2019-04-20, 06:53 AM - Forum: General Discussions - Replies (3)

Hello there,

for now I use SAMPFUNCS and Reconnect plugin to debug my gamemode. It's much easier and faster to reconnect to my debugging server after I compile my gamemode, but I have a problem - it's only compatible with 0.3.7.



My question is does someone made SAMPFUNCS version compatible with 0.3.DL? Or maybe someone would create a .asi plugin or something else to make debugging easier on 0.3.DL?


  [Help] Convert code written on YSI 4.x to 5.x(y_inline and y_malloc)
Posted by: MattHudson - 2019-04-20, 03:27 AM - Forum: Pawn Scripting - Replies (4)

Hi guys, i'm trying to convert this code:

Code:
? ?new

? ? ? ?cb_data[E_CALLBACK_DATA]

? ?;



? ?cb_data[E_CALLBACK_DATA_ALLOC] ? ? ?= ResolvedAlloc: address;

? ?cb_data[E_CALLBACK_DATA_POINTER] ? ?= Function: pointer;

? ?cb_data[E_CALLBACK_DATA_OFFSET] ? ? = offset;

? ?cb_data[E_CALLBACK_DATA_FORMAT][0] ?= data1;

? ?cb_data[E_CALLBACK_DATA_FORMAT][1] ?= data2;



To YSI 5.x Inline, but i really don't know what to do or how to start...

I read?y_inline_impl2.inc documentation and note "How to convert from old y_inline to new y_inline:", but i didn't understand it.



Thanks for reading!


  Returning strings and arrays
Posted by: IllidanS4 - 2019-04-20, 12:07 AM - Forum: Tutorials - Replies (3)

While functions in Pawn typically return only simple cell-sized values, the language does allow for (even native) functions to return arrays and therefore also strings. However, the mechanism that allows it is a bit more complex and may not be suited for some use cases.



First of all, let's look at the standard way of getting a string out of a function.



Via an output parameter

All native SA-MP functions produce a string via a standard non-const array parameter. Since arrays are passed by reference (meaning the function gets access to the actual variable and not just the value inside), the native function can easily store any data inside:

Code:
new name[MAX_PLAYER_NAME  1];

GetPlayerName(playerid, name, sizeof name);

Usually, another parameter is used alongside the array parameter to specify the length of the array. In Pawn, there is no simple way to obtain the length of an array directly at runtime, and so the compiler has to provide the length when needed (the sizeof operator). For strings, an extra cell must be allocated in the array to store the null character, indicating the end of the string (hence the 1).



This way is especially useful for obtaining variable-length arrays (such as strings). The format function, for example, can be only implemented for this way, because the theoretical length of the output string is unlimited.



Returning an array directly

If you want to produce a fixed-size array, you can return it from a function directly:

Code:
forward [MAX_PLAYER_NAME  1]PlayerName(playerid);

stock PlayerName(playerid)

{

??? new name[MAX_PLAYER_NAME  1];

??? GetPlayerName(playerid, name, sizeof name);

??? return name;

}

The forward declaration is optional, but it is useful since it makes you keep in mind that the length of the array is important.



Now, if you know a bit of other languages like C etc., you may be aware that since name is allocated on the stack, it doesn't exist anymore when the function returns. Pawn gets over this fact using a trick ? when the function is called, an extra space for the array is allocated, and the address of this variable is provided to the function via a secret parameter.



In reality, the function looks like this:

Code:
stock PlayerName(playerid, output[MAX_PLAYER_NAME  1])

{

??? new name[MAX_PLAYER_NAME  1];

??? GetPlayerName(playerid, name, sizeof name);

??? output = name;

}

As you can see, returning a string is just a convenient syntactic shortcut for an extra output parameter.



However, this comes at a cost of slightly decreased performance and bugs in certain cases. Let's start with the issues:

Code:
stock Select(index, arg[], arg2[])

{

??? if(index == 0) return arg;

??? return arg2;

}

This simple function seems to return one of the arguments, but since they have indeterminate sizes (represented as 0), the compiler thinks this function returns a zero-sized array and does not actually allocate any extra space for the string. You cannot return strings (or arrays) that have indeterminate length, and the compiler sometimes fails to inform you about this.



Code:
forward [4]Func1();

stock Func1()

{

??? new str[] = "abc";

??? return str;

}



forward [4]Func2();

stock Func2()

{

??? return Func1();

}

This code is also horribly wrong, but in a subtle way. Func2 does allocate extra space for the array returned from Func1, but before the array can be copied to the secret output array of the second function, it is deallocated again and isn't accessible anymore.



Code:
stock Func(...)

{

??? new str[] = "abc";

??? return str;

}

The extra output argument is placed at the end of all arguments, even after the variadic ones. However, the compiler fails to correctly obtain the return address in this case, and assumes its position is constant.



In all these cases, returning a string is a really bad thing to do, since the code usually compiles fine, and the issue only becomes apparent at runtime.



There is a slight performance cost associated with returning arrays as well: the output = name; always happens if the function is implemented in Pawn, and so the array is copied at least once. Take a look at this code:



Code:
new name[MAX_PLAYER_NAME  1]; // = PlayerName(playerid); doesn't work, direct assignment isn't supported

name = PlayerName(playerid);

The compiler again allocates extra space for the string returned from PlayerName (always on the heap), before it moves it to name. Therefore, the array has to be unnecessarily copied twice before it is usable.



As you can see, returning arrays has some significant drawbacks, but it is still useful in some cases, when you are cautious.

Code:
format(string, sizeof string, "Your name is %s.", PlayerName(playerid));

This is the intended usage of returning arrays ? as temporary arguments to other functions. In all other cases, using a normal output parameter is safer and faster. In this case, no extra copying happens at the caller's site.



PlayerName itself can be "fixed" to return the string directly without unnecessary copying, via in-line assembly:

Code:
forward [MAX_PLAYER_NAME  1]PlayerName(playerid);

stock PlayerName(playerid)

{

??? #assert MAX_PLAYER_NAME  1 == 25

??? #emit PUSH.C 25 // size parameter of GetPlayerName

??? #emit PUSH.S 16 // secret return parameter of PlayerName at address 16 (&playerid  4)

??? #emit PUSH.S playerid // equal to 12

??? #emit PUSH.C 12 // number of bytes passed to the function (4 * 3 arguments)

??? #emit SYSREQ.C GetPlayerName // calling the function

??? #emit STACK 16 // cleanup of the arguments from the stack

??? #emit RETN

}

This way, PlayerName does no extra copying, passing the secret return address directly to GetPlayerName.



PawnPlus strings

Dynamic strings in PawnPlus offer the flexibility and convenience of normal values, since they are passed around as references.

Code:
stock String:Func()

{

??? return str_new("abc");

}

The string can be returned from functions, passed to other functions or even to native functions, inspected, or modified, and all of this without any additional copying.



Constant strings

All the previous methods are suitable for strings that are produced at runtime, but for constant strings, I'd advise against using any of them. Use macros instead.



Code:
new const _tips[][] = {

??? "Tip one",

??? "Tip two",

??? "Tip three",

??? "Tip four"

};

#define RandomTip() (_tips[random(sizeof _tips)])

Using this in functions like SendClientMessage requires no string copying at all, since the address of the string is used directly. You can also afford to use variable-length strings in the array, resulting in a little more efficient storage.


  Own logos
Posted by: solstice - 2019-04-19, 11:59 PM - Forum: Art - Replies (1)

removed


  Antiddos Server's
Posted by: air - 2019-04-19, 10:46 PM - Forum: Questions and Suggestions - Replies (1)

Protege a los servidores para que no los ataquen.