Object Editor command 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: Object Editor command problem (
/showthread.php?tid=560261)
Object Editor command problem -
maximthepain - 27.01.2015
Hey when im using the following command its editing the object but returning command not found in the server.
pawn Код:
CMD:object(playerid, params[])
{
new object, description[64], string[128];
//if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,COLOR_RED,"You cant use this command!");
if(sscanf(params,"ds[64]",object, description)) return SendClientMessage(playerid,COLOR_RED,"USAGE: /object [objectid] [description]");
new Float:px, Float:py, Float:pz, Float:rx, Float:ry, Float:rz;
GetPlayerPos(playerid, px, py, pz);
new newobject = CreateDynamicObject(object, px+2, py+2, pz, 0.0, 0.0, 0.0);
EditDynamicObject(playerid, newobject);
InGameObjects[newobject][oObjectDesc] = description;
InGameObjects[newobject][oID] = 0;
InGameObjects[newobject][oObjectID] = object;
format(string, sizeof(string),"{0BDDC4}[Object Editor]{FFFFFF} Editing objectid %d, sqlid %d, description: %s", object, newobject, description);
SendClientMessage(playerid, COLOR_WHITE, string);
return 1;
}
enum:
pawn Код:
enum _igObjects
{
oID,
oObjectID, // Model ID
Float:ofX,
Float:ofY,
Float:ofZ,
Float:orX,
Float:orY,
Float:orZ,
oObjectDesc[64]
};
new InGameObjects[MAX_IG_OBJECTS][_igObjects];
Why the command isn't working??
Re: Object Editor command problem -
Jefff - 27.01.2015
Do you see SendClientMessage in command? if not
1. MAX_IG_OBJECTS is too small
2. new newobject = CreateDynamicObject created ID is out of MAX_IG_OBJECTS