Object - 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: Object (
/showthread.php?tid=548563)
Object -
BoU3A - 30.11.2014
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
Re: Object -
BoU3A - 30.11.2014
helpppppppp
Re: Object -
iiNzTicTx - 30.11.2014
You'll have to provide some code at least. To me it sounds like either getting the parameters incorrectly or somewhere about detecting if the selected object is valid and actually selecting the right one.
You're using a dynamic object system right?
Re: Object -
BoU3A - 30.11.2014
Take a look at the video when i select object its select the last object i have created not the one i have click on i hope you understand me =/
https://www.youtube.com/watch?v=awBc...ature=*********
PHP код:
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;
}
PHP код:
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;
}
Re: Object -
BoU3A - 01.12.2014
helppppppppppp
Re: Object -
Write - 01.12.2014
This'll work.
pawn Код:
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;
}