This should work, as the '= CreateDynamicObject(...' line returns the id of the created object. I am also assuming this is how you are attempting to use it.
pawn Код:
CMD:gotoobject(playerid, params[])
{
if(!IsCnRAdmin(playerid)) return UnknownCMD(playerid);
new objectid;
if(sscanf(params, "d", objectid)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /gotoobject (Object Editing ID)");
if(Dead[playerid] == 1) return SendClientMessage(playerid, COLOR_RED, "You Cannot Use This Command When Dead.");
if(IsSpecing[playerid] == 1) return SendClientMessage(playerid, COLOR_RED, "You Cannot Use This Command When Spectating.");
if(PlayerObjectCount[playerid] == 0) return SendClientMessage(playerid, COLOR_RED, "You Have No Objects To Go To. Use /addobject");
if(objectid > PlayerObjectCount[playerid]) return SendClientMessage(playerid, COLOR_RED, "Invalid Object Editing ID");
new Float:xo, Float:yo, Float:zo;
GetObjectPos(PlayerObject[playerid][objectid], xo, yo, zo);
SetPlayerPos(playerid, xo+1, yo+1, zo+1);
AdminCMD(playerid, "GOTOOBJECT");
return 1;
}