05.05.2011, 22:20
Okay so what I want to do is create a command where the player is able to create a object in game... And then remove it if near by, there is one problem though... How can I get that particler object id? Would I do this?
So would that work if the person is creating multiple objects? So say he creates 5 of those, will it remove them all?
pawn Код:
CMD:exampleobjectcreate(playerid, params[])
{
new Float:x, Float:y, Float:z, objectdropped[MAX_PLAYERS];
GetPlayerPos(playerid, x, y, z);
objectdropped[playerid] = CreateDynamicObject(1508, 369.2036, 162.4440, 1019.9944, 0.0000, 0.0000, 180.0000);
return 1;
}
pawn Код:
CMD:exampleobjectdelete(playerid, params[])
{
new Float:x, Float:y, Float:z;
GetDynamicObjectPos(objectdropped[playerid], x, y, z);
if(IsPlayerInRangeOfPoint(playerid, 5, x, y, z)
{
DestroyDynamicObject(objectdropped[playerid]);
}
else
{
SendClientMessage(playerid, COLOR_RED, "Test No");
}
return 1;
}