01.06.2013, 08:57
How can I make something happen when the moveobject has arrived its position?
public OnObjectMoved(objectid)
{
return 1;
}
public OnPlayerObjectMoved(playerid, objectid)
{
return 1;
}
|
pawn Код:
|
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;
}
// 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;
}