I want to make a predator system with onplayerclickmap.
Code:
public OnObjectMoved(objectid)
{
if(objectid == missle)
{
new Float:p, Float:q, Float:r, Float:s;
GetObjectPos(missle, p, q, r);
GetObjectPos(flare, p, q, r);
MapAndreas_FindZ_For2DCoord(p,q,s);
DestroyObject(missle);
DestroyObject(flare);
CreateExplosion(p, q, s, 7, 6000.0);//6.0
CreateExplosion(p, q, s, 7, 6000.0);//6.0
return 1;
}
return 0;
}
public OnPlayerClickMap(playerid, Float:fX, Float:fY, Float:fZ)
{
MapAndreas_FindZ_For2DCoord(fX,fY,fZ);
MoveObject(missle, fX, fY, fZ, speed);
MoveObject(flare, fX, fY, fZ, speed);
SetCameraBehindPlayer(playerid);
SetPVarInt(playerid, "mc", 0);
TogglePlayerControllable(playerid, 1);
SendClientMessageToAll(COLOR_LIGHTBLUE,"Enemy Predator Activated!");
return 1;
}
But when i put a marker on map it only says enemy predator activated, i wait for some seconds but nothing happens.