27.05.2014, 03:37
Three this functions is good for my fcnpc zombie
Edit:functions have 1 warning
Fix:
Edit:functions have 1 warning
PHP Code:
warning 202: number of arguments does not match definition
PHP Code:
stock FCNPC_GoToPlayerEx(npcid, playerid, Float:dist, Float:rangle, movetype = MOVE_TYPE_WALK, UseZMap = 0)
{
new Float:x, Float:y, Float:z, Float:fa;
GetPlayerPos(playerid, x, y, z);
GetPlayerFacingAngle(playerid, fa);
rangle += fa;
x = (x + dist * floatsin(-rangle,degrees));
y = (y + dist * floatcos(-rangle,degrees));
FCNPC_GoTo(npcid, x, y, z,movetype,UseZMap);
}
PHP Code:
stock FCNPC_GoToPlayerEx(npcid, playerid, Float:dist, Float:rangle, movetype = MOVE_TYPE_WALK, UseZMap = 0)
{
new Float:x, Float:y, Float:z, Float:fa;
GetPlayerPos(playerid, x, y, z);
GetPlayerFacingAngle(playerid, fa);
rangle += fa;
x = (x + dist * floatsin(-rangle,degrees));
y = (y + dist * floatcos(-rangle,degrees));
FCNPC_GoTo(npcid, x, y, z,movetype,10, UseZMap);//10 is Speed when npc use car you can change.
}