17.11.2014, 14:04
when i do /toys & edit the player has to insert Y,X etc, i want one that he can just drag the toy?
CMD:toys(playerid, params[])
{
new Toy; // Variable
Toy = CreateObject(.....); // Will create that object !
EditObject(playerid,Toy); // Will start edit mode .
return 1;
}
public OnPlayerEditObject(playerid, playerobject, objectid, response, Float:fX, Float:fY, Float:fZ, Float:fRotX, Float:fRotY, Float:fRotZ)
{
new Float:oldX, Float:oldY, Float:oldZ,
Float:oldRotX, Float:oldRotY, Float:oldRotZ;
GetObjectPos(Toy, oldX, oldY, oldZ);
GetObjectRot(Toy, oldRotX, oldRotY, oldRotZ);
if(!playerobject)
{
if(!IsValidObject(Toy)) return;
MoveObject(Toy, fX, fY, fZ, 10.0, fRotX, fRotY, fRotZ);
}
}
return 1;
}