createobj help
#1

So i have the command for /createobj and it works fine, But I want to make it so it uses the new object thing, the one that pulls up the menu and you can see pictures of the object.

Command as of now

Код:
CMD:createobj(playerid, params[])
{
	new string[128], object;
   	if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
	if(PlayerInfo[playerid][pMapper] < 1) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
	if(!mDuty[playerid]) return SendClientMessage(playerid, COLOR_GREY, "You are not on Mapper Duty.");
	if(sscanf(params, "i", object)) return SendClientMessage(playerid, COLOR_WHITE, "[Usage]: /createobj [objectid]");

	for(new idx=1; idx<MAX_OBJ; idx++)
	{
	    if(!ObjInfo[idx][oModel])
	    {
	        GetPlayerPos(playerid, ObjInfo[idx][oX], ObjInfo[idx][oY], ObjInfo[idx][oZ]);
  			ObjInfo[idx][oModel] = object;
  			oldoID = ObjInfo[idx][oModel];
  			oldodX = ObjInfo[idx][oX];
  			oldodY = ObjInfo[idx][oY];
  			oldodZ = ObjInfo[idx][oZ];
  			oldodRX = ObjInfo[idx][oRX];
  			oldodRY = ObjInfo[idx][oRY];
  			oldodRZ = ObjInfo[idx][oRZ];
			ObjInfo[idx][oX] = ObjInfo[idx][oX] + 2;
			ObjInfo[idx][oY] = ObjInfo[idx][oY] + 2;
			ObjInfo[idx][oRX] = 0;
			ObjInfo[idx][oRY] = 0;
			ObjInfo[idx][oRZ] = 0;
			// Creating
			format(string, sizeof(string), "Object ID: %d (Model ID: %d)", idx, ObjInfo[idx][oModel]);
			ObjInfo[idx][obj] = CreateDynamicObject(ObjInfo[idx][oModel], ObjInfo[idx][oX], ObjInfo[idx][oY], ObjInfo[idx][oZ], ObjInfo[idx][oRX], ObjInfo[idx][oRY], ObjInfo[idx][oRZ]);
			ObjInfo[idx][oText] = CreateDynamic3DTextLabel(string, COLOR_WHITE, ObjInfo[idx][oX], ObjInfo[idx][oY], ObjInfo[idx][oZ], 10);
			// Text
			format(string, sizeof(string), "MapperWarn: %s has created object ID %d. (Object: %d)", RPN(playerid), idx, object);
		    SendMapperMessage(COLOR_GREEN, 1, string);
			Log("logs/cbject.log", string);
			idx = MAX_OBJ;
		}
	}
	return 1;
}
Please help me make this command i have tried the last 2-3 days and just need help now
Reply


Messages In This Thread
createobj help - by MichaelWharton101 - 05.04.2013, 14:42

Forum Jump:


Users browsing this thread: 1 Guest(s)