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

Username
  

Password
  





Search Forums



(Advanced Search)

Forum Statistics
» Members: 7,662
» Latest member: asepliando16
» Forum threads: 2,347
» Forum posts: 12,288

Full Statistics

Online Users
There are currently 320 online users.
» 1 Member(s) | 316 Guest(s)
Baidu, Google, Yandex, Adrianayng

Latest Threads
How to Complete “Keeping ...
Forum: Questions and Suggestions
Last Post: rodeon
Yesterday, 07:26 AM
» Replies: 0
» Views: 25
Ultimate Roleplay!!
Forum: Advertisements
Last Post: URP_Wrzosek
2025-11-03, 09:43 AM
» Replies: 2
» Views: 89
samp openmp scripts
Forum: German/Deutsch
Last Post: pauli
2025-11-01, 01:21 AM
» Replies: 0
» Views: 71
YGG-Reborn
Forum: Advertisements
Last Post: Mw10
2025-10-31, 08:12 AM
» Replies: 0
» Views: 73
[GameMode] Brasil Vida Id...
Forum: Portuguese/Portugu?s
Last Post: Brasil Vida Ideal
2025-10-31, 01:12 AM
» Replies: 0
» Views: 68
Grand Gang War (GGW)
Forum: Advertisements
Last Post: coladaciren
2025-10-30, 10:00 AM
» Replies: 0
» Views: 65
undefined symbol
Forum: Portuguese/Portugu?s
Last Post: leobradoks
2025-10-25, 08:58 PM
» Replies: 1
» Views: 1,632
SA:MP Custom Character Li...
Forum: General Discussions
Last Post: Dilshad
2025-10-22, 04:15 PM
» Replies: 0
» Views: 119
Anyone got old rp scripts...
Forum: General Discussions
Last Post: Bilal
2025-10-21, 01:02 PM
» Replies: 5
» Views: 5,367
Anyone has the SARP Gamem...
Forum: Gamemodes
Last Post: Bilal
2025-10-21, 12:59 PM
» Replies: 0
» Views: 188

 
  Client-side Scripts
Posted by: Sasino97 - 2019-04-19, 05:20 PM - Forum: Questions and Suggestions - Replies (6)

Client-side Scripts

[Image: zXSrDGv.png]



A feature?that I discussed on Discord.

I think it would be an extremely useful feature, once the?open.mp team starts?working on the client.

This would have a lot of advantages, including optimization by removing the useless?amount of traffic sent between the server and the client, and a better responsiveness.



See the speedometer example in the image above. In a normal SA:MP server, the server is continuously asking the client for his velocity, the client answers, then the server tells the client to redraw the text draw, and so on. This forces the developer to be careful of how often to update the text draw, based on how many players does the server usually have, in order not to slow everything down.



Instead, if the server uploads a (compiled) script to the client upon the first connection, in a similar way to how 0.3DL models are uploaded, and then is able to tell the client when to start and stop its execution, then the speedometer example above can be made in a much more effective ways: the client itself, which knows its own vehicle speed, draws its own text draw as defined by the script, as many times per seconds as the developer wants. This creates a better responsiveness at zero bandwidth cost.


  Multiplayer for the New Edition of GTA SA (Android, iOS, UWP, Xbox 360)
Posted by: Sasino97 - 2019-04-19, 04:34 PM - Forum: Questions and Suggestions - Replies (5)

Multiplayer support for the new edition of?GTA San Andreas



[Image: GTA-San-Andreas-for-Android-Features.png]



After having discussed this on the discord channel, I now think it's time to open a thread for this.?Let's start by saying that I know this isn't an easy task, at all. I know that there are major issues with this idea, but still I would like to put it forward.

The advantage of this is basically being able to play multiplayer in?GTA San Andreas in its newer version, that does not have a multiplayer yet (except for Android?which has this unofficial and unauthorized?SA:MP mod).



The main issues would be releated to:
  • things that were added or removed in the new GTA SA

  • the HUD placement, making it necessary for server developers to be aware on where to place text draw

  • mantaining many different platforms all at once

  • platform obstacles, mostly iOS and Xbox 360


Platforms that might be made:
  • Android

  • Windows 10 and Windows 10 Mobile

  • iOS (most likely only jailbreaked devices)

  • Xbox 360 (most likely?only on jailbreaked / flashed?devices, or maybe by using a proxy that runs out of the Xbox)


If there is enough interest in this thing, it's possible that in the future after the first open.mp client has been released,?I may start studying and developing it in my spare time,?based on open.mp source?code since it's open, and with the intention to keep it open source, aligned and up to date with open.mp.


  Thailand
Posted by: srysgag - 2019-04-19, 02:32 PM - Forum: Other - Replies (5)

?????????? /\


Wink Hello everyone!
Posted by: bratva - 2019-04-19, 10:50 AM - Forum: Questions and Suggestions - Replies (3)

After trying hard to create a simple zombie system i got faced?a bug.

I'm creating actors to use them as zombies but after the actor is created you cannot change its facing angle?anymore, if you will see at pictures the?SetPlayerFacingAngle is in the right position but it does not work. (Dynamic actor system still same)

I hope this will be fixed on open.MP.





[Image: gta-sa-2019-04-19-12-32-24-21.png]







[Image: gta-sa-2019-04-19-12-32-30-05.png]







[Image: gta-sa-2019-04-19-12-32-34-91.png]







[Image: gta-sa-2019-04-19-12-33-07-38.png]







[Image: gta-sa-2019-04-19-12-33-10-58.png]







[Image: gta-sa-2019-04-19-12-33-13-98.png]







[Image: gta-sa-2019-04-19-12-33-31-80.png]


  Games - Discounts, Giveaways, Free
Posted by: Wolf - 2019-04-19, 06:37 AM - Forum: Chat - Replies (1)

Thread for sharing major discounts or free giveaways of games.



If you love the Assassin's creed franchise:?

https://register.ubisoft.com/acu-notreda...away/en-US

Ends on the 25th of April!


  Anything WW related
Posted by: Wolf - 2019-04-19, 06:31 AM - Forum: Life - Replies (8)

Thread for the Word War junkies.


  Military technology
Posted by: Wolf - 2019-04-19, 06:30 AM - Forum: Tech - Replies (6)

Thread to discuss about the technology behind the modern military tools (Guns, Aircrafts, Big guns, Tanks, Navy).





Please refrain from going into the political standpoint, thanks.


  Anything aircraft related
Posted by: Wolf - 2019-04-19, 06:21 AM - Forum: Life - Replies (2)

Thread to discuss about anything that lifts a human being off the ground, be it choppers, gliders, personal aircrafts, commercial airplanes as well as military aircrafts.





I myself am a military jets enthusiast.


  [ESP] YSI Secrets
Posted by: #Fede - 2019-04-19, 12:31 AM - Forum: Programaci?n - Replies (5)

Esta es una traduccion de esta gu?a?para VisualTexture



?Introduccion

Hay una gran cantidad de temas que hablan sobre gran parte de YSI, pero generalmente se ignoran peque?os detalles de YSI. El punto de este tema es mostrar la mayor?a de estos detalles para facilitar el desarrollo a la hora de trabajar con YSI.







GLOBAL_TAG_TYPES

Esto es usado en el lugar de los argumentos de una funci?n, por ejemplo, "printf" esta definido as?:



Code:
native printf(const format[], {Float,_}:...);



Usando "{Float,_}" significa que la funcion acepta un rango desde variables "Float" hasta "_" (Integers). Pero que hay de otras como "Text:", "Group:" o "Menu:". Podrias escribir as?:



Code:
native printf(const format[], {Float, Text, Menu, _}:...);



Pero YSI incluye GLOBAL_TAG_TYPES, una definicion que permite ahorrarnos esa tarea al agregar la mayoria de tags de variables.



Code:
native printf(const format[], GLOBAL_TAG_TYPES:...);



Que se transformaria en esto en el preprocessor:



Code:
native printf(const format[], {_, Language, Bit, Text, Menu, Style, XML, Bintree, Group, Timer, File, Float, Text3D}:...);







PP_LOOP

"PP_LOOP" es un loop preprocessor, lo que significa que genera multiples bloques de codigo, por ejemplo:

Code:
PP_LOOP<5>(printf("hi");)()

Compilara como

Code:
printf("hi");printf("hi");printf("hi");printf("hi");printf("hi");



La definicion de este macro es esta:

Code:
PP_LOOP<veces>(texto/codigo a imprimir)(separador)



Otro ejemplo de PP_LOOP:

Code:
PP_LOOP<10>(55)(, )



Compilaria como:

Code:
55, 55, 55, 55, 55, 55, 55, 55, 55, 55



Notese la falta de ',' al final ya que no esta separando nada.







__COMPILER_PASS

El compilador PAWN hace dos etapas de pre-processing. Es raro que esto sea un problema, pero si necesitas saber en que etapa esta corriendo el compilador puedes hacer:



Code:
#if __COMPILER_PASS == 0

#else // 1 para la segunda etapa

#endif



De manera alternativa, puedes usar:



Code:
#if COMPILER_1ST_PASS

#else // Si es la segunda etapa (COMPILER_2ND_PASS)

#endif







y_cell



Esta es una libreria para una rapida manipulacion de bits en cells:



Code:
Cell_ReverseBits(cell);



Invierte todos los bits de la cell:



Ejemplo: 0b11110000000000000000000000000000

Pasa a: 0b00000000000000000000000000001111



Ejemplo: 0b10110011100011110000111110000010

Pasa a: 0b01000001111100001111000111001101



Ejemplo: 0b01010101010101010101010101010101

Pasa a: 0b10101010101010101010101010101010



Code:
Cell_ReverseNibbles(cell);

Invierte todos los nibbles de una cell.



Ejemplo: 0x12345678

Pasa a: 0x87654321



Ejemplo: 0x010F0703

Pasa a: 0x3070F010



Ejemplo: 0xF0F0F0F0

Pasa a: 0x0F0F0F0F



Code:
Cell_CountBits(cell);

Cuenta todos los '1' de una cell.



Ejemplo: 0

Retorna: 0



Ejemplo: 1

Retorna: 1



Ejemplo: 0x01010101

Retorna: 4







Keywords

La mayoria de gente sabe que YSI agrega "foreach" al lenguaje PAWN, aqui una lista de otras keywords a?adidas:



task - Timer que siempre esta corriendo mientras el servidor esta encendido (y_timers)



Code:
task Ping[1000]()

{

? ? printf("Pong!");

}



ptask - Similar a la keyword task, pero tiene el parametro de playerid. (y_timers)



Code:
ptask PlayerPing[1000](playerid)

{

? ? printf("Ping %d", playerid);

}



loadtext - Carga strings localizados en un archivo para mostrar texto (y_text)

Code:
loadtext core[ysi_properties];



remote - Una funcion publica que puede ser llamada desde otros scripts con verificaci?n de par?metros en la compilaci?n (y_remote)



Code:
remote MyFunc(a, b[])

{

}



broadcastfunc - Llama una funcion remota en todos los otros scripts (y_remote)

Code:
broadcastfunc MyFunc(42, "Hello world!");



inline - Declara una funci?n dentro de otra funci?n, con acceso a las variables de la funci?n (y_inline)



Code:
stock Outer(a)

{

? ? inline Inner(b)

? ? {

? ? ? ? printf("%d %d", a, b);

? ? }

}



using - Pasar una funci?n de inline a otra funci?n como un callback (y_inline)

Code:
INI_Parse(file, using inline Local_Parse);



hook - Usar un callback m?ltiples veces en m?ltiples archivos son conflicto (y_hooks)



Code:
hook OnPlayerConnect(playerid)

{

}



global - Corriendo multiples scripts, solo uno debe cargar la funci?n. Esto declara la funci?n como global, as? todos los scripts pueden usarla pero solo uno debe cargarla. (y_master)



Code:
global AC_GiveWeapon(playerid, weaponid, ammo)

{

}



Su diferencia con remote es que esta es solo es llamada en un script mientras que remote es llamada en todos los scripts.



foreign - Informa que esa funci?n se encuentra en otro script. (y_master)

Code:
foreign AC_GiveWeapon(playerid, weaponid, ammo);







OnScriptInit y OnScriptExit (y_serverinit)

Tiene el mismo funcionamiento que OnGameModeInit/Exit o OnFilterScriptInit, una opci?n ?til para inicializar c?digo sin importar si se esta en un Filterscript o en una Gamemode.



Code:
public OnScriptInit()

{

}



public OnScriptExit()

{

}







Asignaci?n din?mica de memoria (y_malloc)

Usando YSI puedes alocar y liberar memoria cuando quieras:

Code:
main()

{

? new Alloc:a = malloc(1000); // Reservamos mil celdas de memoria.



? mset(a, 0, 50); // Escribimos "50" en el primer slot.



? // Pasamos nuestro array a nuestra funcion.

? func(mget(a, 0), Malloc_SlotSize(a));



? // Y por ultimo liberamos la memoria (o nos quedaremos sin memoria)

? free(a);

}

func(arr[], size)

{

? ? for (new i = 0; i != size; ) printf("%d", arr[i]);

}







Restringiendo conexiones (y_flooding)

Puedes limitar el m?ximo de conexiones que pueden realizarse a tu servidor desde la misma IP:

Code:
SetMaxConnections(3);



Esto permitir? que se conecten hasta 3 personas desde la misma IP. Si otra mas intenta entrar, autom?ticamente no podr?n lograr conectarse. Puedes cambiar el m?ximo y la acci?n al superar el limite.



Code:
SetMaxConnections(5, e_FLOOD_ACTION_BAN);

Esto limitara las conexiones a 5, y si otra persona intenta entrar la IP sera baneada y los jugadores sufriran timeout.


  • e_FLOOD_ACTION_BLOCK -> No permite mas conexiones (default)

  • e_FLOOD_ACTION_KICK? -> Kickea a todos usando esta IP.

  • e_FLOOD_ACTION_BAN? ->? Banea la IP, los jugadores sufriran timeout.

  • e_FLOOD_ACTION_FBAN? ->? Banea la IP y kickea a los jugadores conectados con esta IP.






Variables temporales

A veces necesitas una variable por una fracci?n de segundo. YSI ya trae 3 variables para evitar crear mas de estas: I@, J@ y Q@[YSI_MAX_STRING].

Code:
#define ReturnPlayerHealth(%0) (GetPlayerHealth((%0), Float:I@), Float:I@)

#define ReturnPlayerName(%0) (GetPlayerName((%0), Q@, 24), Q@)

Estas variables son globales, y no se puede confiar si mantiene los mismos datos luego de llamar una funci?n, as? que esto podria no funcionar:

Code:
J@ = 123;

FuncionAleatoria();

printf("%d", J@);

No hay manera de saber si FuncionAleatoria modifica el valor de J@.







Funciones acortadas

YSI tiene unas cuantas funciones acortadas, principalmente para utilizarlas en los macros.
  • U@ -> setproperty

  • V@ -> getpropery

  • W@ -> CallRemoteFunction

  • P@ -> CallLocalFunction

  • O@ -> SetTimerEx

  • K@ -> SetTimer (Parece no funcionar en YSI 5)






Prints de desbug

Si compilas tu Gamemode con alguna libreria de YSI y algun nivel de _DEBUG activo, al iniciar tu servidor YSI imprimir? informacion especifica dependiendo del nivel asignado.



Code:
#include <a_samp>

#define _DEBUG 3

#include <YSI_Coding\y_inline>



El numero despu?s del _DEBUG es el nivel de debug. Existen 8 niveles.
  • 0 -> Nada de debug.

  • 1 -> Muestra las llamadas a funciones publicas (callbacks y timers)

  • 2 -> Muestra las llamadas a las funciones de la API (Funciones principales de YSI)

  • 3 -> Muestra las llamadas a stocks de YSI. (Funciones secundarias de YSI)

  • 4 -> Muestra las llamadas a funciones internas de YSI

  • 5 -> Muestra informaci?n extra de debug entre funciones.

  • 6 -> Muestra informaci?n de loops (Prints entre loops)

  • 7 -> Muestra informaci?n de loops (Prints en loops)


Deber?as evitar utilizar el niveles 6-7, solo al iniciar el servidor ya generara unos cuantos MB de datos en el log.



Para imprimir tus propios mensajes de debug usa "P:<Nivel>(Mensaje)":

Code:
P:5("Este mensaje sera imprimido en el nivel 5 para arriba");







Prints especiales

Ademas de los 8 niveles mencionados arriba, hay algunos niveles especiales:

Code:
P:F("Mensaje de error fatal");

// Imprime "*** YSI Fatal Error: <Tu mensaje>" y hace 5 beeps para alertar del error.

Code:
P:E("Mensaje de error");

// Imprime "*** YSI Error: <Tu mensaje>" y hace 3 beeps para alertar del error

Code:
P:W("Mensaje de advertencia");

// Imprime "*** YSI Warning: <Tu mensaje>" y hace un solo beep para alertar del error.

Code:
P:I("Mensaje de informacion");

// Imprime "*** YSI Info: <Tu mensaje>", no hace ningun beep. Similar a P:0.



Estos prints especiales siempre estan activos al compilar debido a que le dan informaci?n importante al usuario sobre errores en el codigo; no es solo informaci?n random de debug. De igual manera, pueden desactivarse poniendo esto en el c?digo:

Code:
state ysi_debug : off;







Prints dinamicos

Con y_debug puede usarse _DEBUG con valor -1, esto activa la posibilidad de modificar el nivel de debug en ejecuci?n, entonces, esto:

Code:
P:3("Message");

Compila como:

Code:
if (gDebugLevel >= 3) printf("Message");



Para cambiar el nivel en ejecucion, simplemente se usa esto:

Code:
DebugLevel(3);



Colocandolo en 0 desactiva la mayoria de prints de desbug (excepto los especiales mostrados arriba). Ademas, es posible obtener el nivel de debug.

Code:
new nivel = DebugLevel();







Tags especiales

YSI introduce dos tipos especiales de tags para funciones. Estos pueden ser utilizados para optimizar c?digos en ciertas circunstancias:
  • void - Gente que conozca el lenguaje de C reconocer? esto como "no return", en resumen; La funci?n no retorna nada.

    Code:
    void:Func()

    {

    ? ? // No return.

    }

    Usando y_master, este tag genera el c?digo mas r?pido, y da un error si se usa return en la funci?n.?



  • string - Este es un tag usado en todo YSI, no solo como un tipo de return. Cualquier cosa con el tag "String:" es solo un string normal, y es completamente compatible con strings regulares, pero hay veces que es util para el compilador saber la diferencia entre un string y un array.

    Code:
    string:Func(string:a[], b[])

    {

    ? ? //Funcion que toma un string (a) y un array (b) y retorna un string.

    }






IS_IN_RANGE

YSI incluye una funcion muy util para simplificar la verificaci?n de valores. Como su nombre indica, la funci?n sirve para comprobar si algo esta dentro de un rango.

Code:
if(IS_IN_RANGE(abc, 1, 100))



Este c?digo comprueba si abc esta entre 1 y 100, devolviendo true si esta o false si no.







RUN_TIMING

Esta es una manera simplificada de obtener estad?sticas al comparar dos c?digos PAWN.

Code:
RUN_TIMING("Version 1 ()")

{

? ? a = b  5;

}

RUN_TIMING("Version 2 (=)")

{

? ? a = b;

? ? a = 5;

}



Imprimira algo as? en la consola:

Code:
Timing "Version 1 ()"...

? ? ? ? ? Mean = 78.00ns

? ? ? ? ? Mode = 76.00ns

? ? ? ? Median = 78.00ns

? ? ? ? ?Range = 9.00ns

Timing "Version 2 (=)"...

? ? ? ? ? Mean = 94.00ns

? ? ? ? ? Mode = 94.00ns

? ? ? ? Median = 94.00ns

? ? ? ? ?Range = 15.00ns



Si no sabes de estad?stica, elige la que tenga el menor "Mean", o mejor aprende estad?stica.?



Hay un segundo par?metro opcional que es el numero de loops si el experimento fue muy r?pido o muy corto.

Code:
RUN_TIMING("Version 2 (=)", 100)







Cr?ditos:
  • Ada32 - Escribir la gu?a en ingles originalmente

  • #Fede - Traducci?n de la gu?a?


  deleted
Posted by: Atom - 2019-04-19, 12:00 AM - Forum: Chat - Replies (4)

deleted