Как правильно использовать замену стандартной функции?
Как правильно использовать замену стандартной функции
PHP код:
#define SetPlayerPos SetPlayerPos_protect
stock SetPlayerPos_protect(playerid, Float:x,Float:y,Float:z)
{
Player_Off_Protect{playerid} = 3;
Player_Pos[0][playerid] = x;
Player_Pos[1][playerid] = y;
Player_Pos[2][playerid] = z;
#if defined SetPlayerPos
#undef SetPlayerPos
#endif
SetPlayerPos(playerid, x,y,z);
#define SetPlayerPos SetPlayerPos_protect
return 1;
}
или
PHP код:
stock SetPlayerPos_protect(playerid, Float:x,Float:y,Float:z)
{
Player_Off_Protect{playerid} = 3;
Player_Pos[0][playerid] = x;
Player_Pos[1][playerid] = y;
Player_Pos[2][playerid] = z;
#if defined SetPlayerPos
#undef SetPlayerPos
#endif
SetPlayerPos(playerid, x,y,z);
#define SetPlayerPos SetPlayerPos_protect
return 1;
}
#define SetPlayerPos SetPlayerPos_protect
есть ли какойто порядок - в какой последовательности должны идти строки?