updating object scale and offsets in attached objects
#3

I was thinking about something like moveattachedobject or something for this but sure lol
Код:
public OnPlayerEditAttachedObject(playerid, response, index, modelid, boneid, Float:fOffsetX, Float:fOffsetY, Float:fOffsetZ, Float:fRotX, Float:fRotY, Float:fRotZ, Float:fScaleX, Float:fScaleY, Float:fScaleZ)
{
	if(response)
	{
	    if(USER[playerid][ADMIN]>30)
		{
			if(index==8)
	    	{
				new text[100];
				format(text,sizeof(text),"%f,%f,%f,%f,%f,%f,%f,%f,%f",fOffsetX,fOffsetY,fOffsetZ,fRotX,fRotY,fRotZ,fScaleX,fScaleY,fScaleZ);
				SCM(playerid,COLOR_RED,text);
	    	}
		}
		new query[700],objectid,itemdb;
	    objectid=GetPVarInt(playerid,"EDITSLOT");
	    if(objectid==0)
	    {
	        itemdb=GetPVarInt(playerid,"OBJ1");
	    }
	    if(objectid==1)
	    {
	        itemdb=GetPVarInt(playerid,"OBJ2");
	    }
	    if(objectid==2)
	    {
	        itemdb=GetPVarInt(playerid,"OBJ3");
	    }
	    if(objectid==3)
	    {
	        itemdb=GetPVarInt(playerid,"OBJ4");
	    }
	    if(objectid==4)
	    {
	        itemdb=GetPVarInt(playerid,"OBJ5");
	    }
	    if(objectid==5)
	    {
	        itemdb=GetPVarInt(playerid,"OBJ6");
	    }
		mysql_format(mysql,query,sizeof(query),"UPDATE *cencored:)* SET offx=%f, offy=%f, offz=%f, rotx=%f, roty=%f, rotz=%f, sizex=%f, sizey=%f, sizez=%f WHERE itemid=%d",fOffsetX,fOffsetY,fOffsetZ,fRotX,fRotY,fRotZ,fScaleX,fScaleY,fScaleZ,itemdb);
	    mysql_query(mysql,query);
	    return 1;
	}
	return 1;
}
NOTE: I run this block only in my gamemode, i dont like running filterscripts as they always feel messier. I just see a code block and just develop more on it then implement it or just make some lines up from my mind then directly implement to my game mode so i don't have to use many enums on different files. Easier to remember and feels more stable
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)