Attach obj
#1

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;
}
Reply
#2

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.
Reply
#3

Tried this too EditAttachedObject(playerid, 0);
Reply
#4

Bump
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)