28.04.2011, 04:34
I have this saving co-ordinates script here, But even though i have folder called "attached", I get "Error saving" , I edited this to save automatically to a file with the same name of the player. I hope you can solve it. Thanks in advance
Код:
CMD:index(playerid,params[]) { if(!IsPlayerInRangeOfPoint(playerid,25.0,207.5627,-103.7291,1005.2578) || IsPlayerInRangeOfPoint(playerid,25.0,203.9068,-41.0728,1001.8047) || IsPlayerInRangeOfPoint(playerid,30.0,214.4470,-7.6471,1001.2109) || IsPlayerInRangeOfPoint(playerid,50.0,161.3765,-83.8416,1001.8047)) { SendClientMessage(playerid,COLOR,"You are not at any Clothing store"); return 1; } if(isnull(params)) { SendClientMessage(playerid,COLOR,"{FFFFFF}/index [1-5] {AFAFAF} - switch to exiting the object on that index"); SendClientMessage(playerid,COLOR,"{FFFFFF}/index [1-5] 0{AFAFAF} - clear the object on that index"); SendClientMessage(playerid,COLOR,"{FFFFFF}/index [1-5] [model#] [bone]{AFAFAF} - add / change object on that index"); return 1; } new iindex,tmp[12],imodel,ibone; new string[128]; if(sscanf(params,"iS()[12]I(2)",iindex,tmp,ibone)) { SendClientMessage(playerid,COLOR,"USAGE: /index [index 1-5] [model# / 0-clear ] [bone 1-18]"); return 1; } if(iindex < 1 || iindex > 5) { SendClientMessage(playerid,COLOR,"USAGE: /index [index 1-5] [model# / 0-clear ] [bone 1-18]"); return 1; } if(!strlen(tmp)) { if(stats[playerid][iindex][model] == 0) { format(string,sizeof(string),"There is no model attached to index %d",iindex); SendClientMessage(playerid,COLOR,string); return 1; } format(string,sizeof(string),"now editing index %d",iindex); SendClientMessage(playerid,COLOR,string); pindex[playerid] = iindex; DisplayIndex(playerid, iindex); return 1; } imodel = strval(tmp); if(imodel <= 0) { RemovePlayerAttachedObject(playerid,(iindex - 1)); stats[playerid][iindex][model] = 0; stats[playerid][iindex][bone] = 0; format(string,sizeof(string),"Attach index %d cleared",iindex); RemovePlayerAttachedObject(playerid,(iindex - 1)); ResetArray(playerid,iindex); SendClientMessage(playerid,COLOR,string); return 1; } if(ibone < 1 || ibone > 18) { SendClientMessage(playerid,COLOR,"Invalid bone selected 1 - 18"); return 1; } pindex[playerid] = (iindex); ResetArray(playerid,iindex); DisplayIndex(playerid,iindex); stats[playerid][iindex][model] = imodel; stats[playerid][iindex][bone] = ibone; SetPlayerAttachedObject(playerid,(pindex[playerid]-1), stats[playerid][pindex[playerid]][model], stats[playerid][pindex[playerid]][bone], stats[playerid][pindex[playerid]][ox], stats[playerid][pindex[playerid]][oy], stats[playerid][pindex[playerid]][oz], stats[playerid][pindex[playerid]][rx], stats[playerid][pindex[playerid]][ry], stats[playerid][pindex[playerid]][rz], stats[playerid][pindex[playerid]][sx], stats[playerid][pindex[playerid]][sy], stats[playerid][pindex[playerid]][sz] ); format(string,sizeof(string),"Attached object# %d to bone %d index %d",imodel,ibone,iindex); SendClientMessage(playerid,COLOR,string); return 1; }