PDA

View Full Version : OnPlayerClickMap


Admigo
19/05/2012, 08:24 AM
Heey all,

I want to make a predator system with onplayerclickmap.
I made:

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.
How can i fix this?

Thanks Admigo

Admigo
19/05/2012, 08:32 AM
Fixed by myself,forget to create the object:P