09.05.2014, 05:20
I have this command but i cant edit it,
edit cmd
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;
}
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;
}