OnPlayerClickMap
#1

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
Reply
#2

Fixed by myself,forget to create the object:P
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)