Attach obj - 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: Attach obj (
/showthread.php?tid=512109)
Attach obj -
Ananisiki - 09.05.2014
I have this command but i cant edit it,
pawn Код:
CMD:atchobj(playerid, params[])
{
new objectid, vehid;
if(sscanf(params, "di", objectid, vehid)) return SendClientMessage(playerid, COLOR_RED, "usage: /attachobject (obj edit id) (veh ID)");
if(PlayerObjectCount[playerid] == 0) return SendClientMessage(playerid, COLOR_RED, "Invalid Object Editing ID.");
if(!IsValidDynamicObject(PlayerObject[playerid][objectid]) || objectid < 1) return SendClientMessage(playerid, COLOR_RED, "Invalid Object Editing ID.");
if(!IsValidVehicle(vehid)) return SendClientMessage(playerid, COLOR_RED, "This Vehicle Doesn't Exist In The Server.");
if(IsPlayerEditingObject[playerid] == 1) CancelEdit(playerid);
else IsPlayerEditingObject[playerid] = 1;
new Float:x, Float:y, Float:z;
AttachDynamicObjectToVehicle(PlayerObject[playerid][objectid], vehid, x, y, z, 0.0, 0.0, 0.0);
return 1;
}
edit cmd
pawn Код:
CMD:editatchobj(playerid, params[])
{
new objectid, vehid;
if(sscanf(params, "di", objectid, vehid)) return SendClientMessage(playerid, COLOR_RED, "usage: /editattachedobject (Object Editing ID) (Vehicle ID)");
if(PlayerObjectCount[playerid] == 0) return SendClientMessage(playerid, COLOR_RED, "Invalid Object Editing ID.");
if(!IsValidDynamicObject(PlayerObject[playerid][objectid]) || objectid < 1) return SendClientMessage(playerid, COLOR_RED, "Invalid Object Editing ID.");
if(!IsValidVehicle(vehid)) return SendClientMessage(playerid, COLOR_RED, "This Vehicle Doesn't Exist In The Server.");
if(IsPlayerEditingObject[playerid] == 1) CancelEdit(playerid);
else IsPlayerEditingObject[playerid] = 1;
EditAttachedObject(vehid, PlayerObject[playerid][objectid]);
return 1;
}
Re: Attach obj -
mrtms - 09.05.2014
You do know EditAttachedObject(vehid,
PlayerObject[playerid][objectid]);, the part that I bolded is the slot the object is in, not the Object's ID.
https://sampwiki.blast.hk/wiki/EditAttachedObject
That could be your problem, assuming you're trying to edit the objects id rather than the slot.
Re: Attach obj -
Ananisiki - 09.05.2014
Tried this too EditAttachedObject(playerid, 0);
Re: Attach obj -
Ananisiki - 10.05.2014
Bump