30.11.2014, 16:41
Hello i have create some objects in my server and i use this "SelectObject" to edit the object but when i click on object it is select the last object i've created not the one i have selected, sorry for my english
new ObjectID, ModelID, Float:oX, Float:oY, Float:oZ;
CMD:object(playerid,params[])
{
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,red,"Command not found! Type /cmds");
if(sscanf(params, "i", ModelID)) return SendClientMessage(playerid,red,"Create object: /object <model>");
{
GetPlayerPos(playerid,oX,oY,oZ);
ObjectID = CreateObject(ModelID,oX,oY,oZ,0,0,0);
EditObject(playerid,ObjectID);
}
return 1;
}
CMD:select(playerid,params[])
{
SelectObject(playerid);
return 1;
}
public OnPlayerSelectObject(playerid, type, objectid, modelid, Float:fX, Float:fY, Float:fZ)
{
if(type == SELECT_OBJECT_GLOBAL_OBJECT)
{
if(IsValidObject(ObjectID))
{
EditObject(playerid,ObjectID);
}
}
return 1;
}
public OnPlayerSelectObject(playerid, type, objectid, modelid, Float:fX, Float:fY, Float:fZ)
{
if(type == SELECT_OBJECT_GLOBAL_OBJECT)
{
if(IsValidObject(objectid))
{
EditObject(playerid,objectid);
}
}
return 1;
}