24.11.2014, 20:28
Hello!
I'm making an in-game object edior, using 0.3e's EditObject(); function.
And I made 3 commands and they're: /co (create object), /eo (edit object), /do (destroy object).
And the thing is the actual object ID? I don't mean the object's model ID, I mean the object ID (1, 2, 3, 7, 14, 21, etc...).
I know there is no such function as GetObjectID, as it wouldn't even make any sense though...
What I want? I want a notification message which will show me the object ID when it's created (not object's model id), same as in /eo and /do command.
Is that even possible?
(Please don't tell me to search the forums, because I did and my eyes hurt, I don't know what to do anymore... So that's why I'm asking for help here, again...)
Here are my commands:
I'm making an in-game object edior, using 0.3e's EditObject(); function.
And I made 3 commands and they're: /co (create object), /eo (edit object), /do (destroy object).
And the thing is the actual object ID? I don't mean the object's model ID, I mean the object ID (1, 2, 3, 7, 14, 21, etc...).
I know there is no such function as GetObjectID, as it wouldn't even make any sense though...
What I want? I want a notification message which will show me the object ID when it's created (not object's model id), same as in /eo and /do command.
Is that even possible?
(Please don't tell me to search the forums, because I did and my eyes hurt, I don't know what to do anymore... So that's why I'm asking for help here, again...)
Here are my commands:
pawn Код:
CMD:co(playerid, params[])
{
if(sscanf(params, "i", oID)) return SendClientMessage(playerid, 0xF81414FF, "USAGE: /co [objectid].");
GetPlayerPos(playerid, X, Y, Z);
CreateObject(oID, X, Y, Z, 0.0, 0.0, 0.0, 300.0);
format(String, sizeof(String), "You have successfully created objectid: %d", oID);
SendClientMessage(playerid, 0x33AA33FF, String);
return 1;
}
pawn Код:
CMD:eo(playerid, params[])
{
if(sscanf(params, "d", oID)) return SendClientMessage(playerid, 0xF81414FF, "USAGE: /eo [objectid].");
if(IsValidObject(oID))
{
EditObject(playerid, oID);
format(String, sizeof(String), "You're now editing objectid: %d", oID);
SendClientMessage(playerid, 0x33AA33FF, String);
}
else
{
SendClientMessage(playerid, 0xF81414FF, "ERROR: Invalid objectid.");
}
return 1;
}
pawn Код:
CMD:do(playerid, params[])
{
if(sscanf(params, "d", oID)) return SendClientMessage(playerid, 0xF81414FF, "USAGE: /do [objectid].");
if(IsValidObject(oID))
{
DestroyObject(oID);
format(String, sizeof(String), "You have successfully destroyed objectid: %d", oID);
SendClientMessage(playerid, 0x33AA33FF, String);
}
else
{
SendClientMessage(playerid, 0xF81414FF, "ERROR: Invalid objectid.");
}
return 1;
}