SA-MP Forums Archive
Como editar una funcion propia de SAMP. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Español/Spanish (https://sampforum.blast.hk/forumdisplay.php?fid=29)
+---- Thread: Como editar una funcion propia de SAMP. (/showthread.php?tid=426287)



Como editar una funcion propia de SAMP. - JuliPera - 28.03.2013

Buenas a todos,
estoy modificando creando algunas funciones para mi servidor que me faciliten bastante el trabajo,
pero necesito modificar una funcion del SAMP (CreateVehicle) y no se como hacerlo.

Yo cree una funcion que hace lo que quiero que haga y le puse iCreateVehicle. Lo que yo quiero hacer es que esta funcion se llame al usar CreateVehicle, teniendo en cuenta que adentro de iCreateVehicle estoy usando la funcion CreateVehicle.

Medio confuso, espero que me entiedan y me den alguna solucion :P


Respuesta: Como editar una funcion propia de SAMP. - adri1 - 28.03.2013

pawn Код:
stock iCreateVehicle(modelid, Float:x, Float:y, Float:z, Float:angle, color1, color2, respawn_delay)
{
        //cуdigo
        return 0;
}
 
#if defined _ALS_CreateVehicle
        #undef CreateVehicle
#else
        #define _ALS_CreateVehicle
#endif
#define CreateVehicle iCreateVehicle
Creo que te refieres a eso, prueba.


Respuesta: Como editar una funcion propia de SAMP. - xSDx - 28.03.2013

Lo que quieres hacer se llama hookear una funcion (hook) un metodo es el que te paso adri1 te sirve.

Saludos.