SA-MP Forums Archive
OnPlayerClickMap - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: OnPlayerClickMap (/showthread.php?tid=343880)



OnPlayerClickMap - Admigo - 19.05.2012

Heey all,

I want to make a predator system with onplayerclickmap.
I made:
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.
How can i fix this?

Thanks Admigo


Re: OnPlayerClickMap - Admigo - 19.05.2012

Fixed by myself,forget to create the object:P