08.02.2015, 16:10
I making system wich must save edited object..
And when i finished with editing object,my object goes to my users.ini file
but when i connect to the server my edited object doesn't show.
And when i finished with editing object,my object goes to my users.ini file
but when i connect to the server my edited object doesn't show.
Код:
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) { SetPlayerAttachedObject(playerid,index,modelid,boneid,fOffsetX,fOffsetY,fOffsetZ,fRotX,fRotY,fRotZ,fScaleX,fScaleY,fScaleZ); SendClientMessage(playerid, 0xFFFFFFFF, "You are save the settings"); new file[256]; new name[24]; new f1[15],f2[15],f3[15],f4[15],f5[15],f6[15],f7[15],f8[15],f9[15],f10[15],f11[15]; GetPlayerName(playerid,name,24); format(file,sizeof(file),"Custom Roleplay/Users/%s.ini",name); if(!dini_Exists(file)) return 1; format(f1,15,"O_Model_%d",index); format(f2,15,"O_Bone_%d",index); format(f3,15,"O_OffX_%d",index); format(f4,15,"O_OffY_%d",index); format(f5,15,"O_OffZ_%d",index); format(f6,15,"O_RotX_%d",index); format(f7,15,"O_RotY_%d",index); format(f8,15,"O_RotZ_%d",index); format(f9,15,"O_ScaleX_%d",index); format(f10,15,"O_ScaleY_%d",index); format(f11,15,"O_ScaleZ_%d",index); dini_IntSet(file,f1,modelid); dini_IntSet(file,f2,boneid); dini_FloatSet(file,f3,fOffsetX); dini_FloatSet(file,f4,fOffsetY); dini_FloatSet(file,f5,fOffsetZ); dini_FloatSet(file,f6,fRotX); dini_FloatSet(file,f7,fRotY); dini_FloatSet(file,f8,fRotZ); dini_FloatSet(file,f9,fScaleX); dini_FloatSet(file,f10,fScaleY); dini_FloatSet(file,f11,fScaleZ); return 1; }
Код:
public OnPlayerSpawn(playerid) { new file[256]; new name[24]; new f1[15],f2[15],f3[15],f4[15],f5[15],f6[15],f7[15],f8[15],f9[15],f10[15],f11[15]; GetPlayerName(playerid,name,24); format(file,sizeof(file),"Custom Roleplay/Users/%s.ini",name); if(dini_Exists(file)) return 1; for(new x;x<MAX_OSLOTS;x++) { format(f1,15,"O_Model_%d",x); format(f2,15,"O_Bone_%d",x); format(f3,15,"O_OffX_%d",x); format(f4,15,"O_OffY_%d",x); format(f5,15,"O_OffZ_%d",x); format(f6,15,"O_RotX_%d",x); format(f7,15,"O_RotY_%d",x); format(f8,15,"O_RotZ_%d",x); format(f9,15,"O_ScaleX_%d",x); format(f10,15,"O_ScaleY_%d",x); format(f11,15,"O_ScaleZ_%d",x); if(dini_Int(file,f1)!=0) { SetPlayerAttachedObject(playerid,x,dini_Int(file,f1),dini_Int(file,f2),dini_Float(file,f3),dini_Float(file,f4),dini_Float(file,f5),dini_Float(file,f6),dini_Float(file,f7),dini_Float(file,f8),dini_Float(file,f9),dini_Float(file,f10),dini_Float(file,f11)); } }