SA-MP Forums Archive
Goto object problem - 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: Goto object problem (/showthread.php?tid=437516)



Goto object problem - [..MonTaNa..] - 15.05.2013

Removed.


Re: Goto object problem - Threshold - 16.05.2013

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;
}



Re: Goto object problem - [..MonTaNa..] - 16.05.2013

Removed.