View Full Version : Command doesnt work... 1 Rep for help.

30/07/2015, 01:59 PM
Hi, samp forum. I'm running my script with mysql system. When i type in my command /makeobject <ObjectID> <Text> it says "Unknown command", but it makes the object. When i then type /whatobject near it, it dont say anything(bca the object isnt in the Database)....

Here is the /makeobject command

CMD:makeobject(playerid, params[])
if(!CheckAdmin(playerid, HIGH_ADMIN_LEVEL)) return NotAuthMSG(playerid);
new objectid, modelid, interior, name[256], Float:X, Float:Y, Float:Z;
if(sscanf(params,"ds[256]",modelid,name)) return SyntaxMSG(playerid, "/makeobject [Object-ID] [Description]");
GetPlayerPos(playerid, X, Y, Z);
interior = GetInterior(playerid);
objectid = CreateDynamicObject(modelid, X, Y, Z, 0.0, 0.0, 0.0, GetWorld(playerid), -1, -1, 200.0);
ObjectsInfo[objectid][oModel] = modelid;
ObjectsInfo[objectid][oPosX] = X;
ObjectsInfo[objectid][oPosY] = Y;
ObjectsInfo[objectid][oPosZ] = Z;
ObjectsInfo[objectid][oPosRX] = 0.0;
ObjectsInfo[objectid][oPosRY] = 0.0;
ObjectsInfo[objectid][oPosRZ] = 0.0;
ObjectsInfo[objectid][oObjectOn] = 1;
ObjectsInfo[objectid][oInterior] = interior;
ObjectsInfo[objectid][oVirtualWorld] = GetWorld(playerid);
format(ObjectsInfo[objectid][oName], 256, "%s", name);
ObjectsInfo[objectid][oObject] = objectid;
AddObjectToFile(objectid, modelid, interior, GetWorld(playerid), X, Y, Z, name);
format(msg, sizeof(msg), "A new dynamic object was added, [ModelID: %d, Description: %s]",modelid, ObjectsInfo[objectid][oName]);
SCM(playerid, COLOR_GREEN, msg);
return 1;

If you need anything else, reply to this and i will as soon as i can text you back...

I can give you the script, but you will need to be HIGH ranked on Sa-Mp forum.