Do something if object arrives at destination - 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: Do something if object arrives at destination (
/showthread.php?tid=441026)
Do something if object arrives at destination -
Sellize - 01.06.2013
How can I make something happen when the moveobject has arrived its position?
Re: Do something if object arrives at destination -
ScRaT - 01.06.2013
pawn Код:
public OnObjectMoved(objectid)
{
return 1;
}
public OnPlayerObjectMoved(playerid, objectid)
{
return 1;
}
https://sampwiki.blast.hk/wiki/OnObjectMoved
Re: Do something if object arrives at destination -
Sellize - 01.06.2013
Quote:
Originally Posted by ScRaT
|
Yeah but i have it like this
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/firework", cmdtext, true, 10) == 0)
{
new blabla;
new Float:pX, Float:pY, Float:pZ;
GetPlayerPos(playerid, pX, pY, pZ);
blabla = CreateObject(2918, pX, pY, pZ, 0.0, 0.0, 100.0);
MoveObject(firework, pX, pY, pZ + 20, 8.00);
SendClientMessage(playerid, -1, "{3EFAF7}k.");
return 1;
}
return 0;
}
public OnObjectMoved(objectid)
{
// Won't work since its a private variable
return 1;
}
Re: Do something if object arrives at destination -
Konstantinos - 01.06.2013
pawn Код:
// global variable
new
firework
;
// OnPlayerCommandText Callback: /firework (NOTE: its lenght is 9, not 10)
firework= CreateObject(..);
MoveObject(firework, ..);
public OnObjectMoved(objectid)
{
if(objectid == firework)
{
// Do something
}
return 1;
}