14.01.2011, 11:05
anyone knows where to get a nice saving tutorial. I just don't understand a bit of saving things in scriptfiles or sort of something like that
CMD:shp(playerid, cmdtext[]){ if(!IsPlayerAdmin(playerid)) { SendClientMessage(playerid,MSGFAIL_COLOR,"Command not available."); return 1; } new Comment[128]; sscanf(cmdtext,"z",Comment); new Float:X,Float:Y,Float:Z,Float:A; GetPlayerPos(playerid,X,Y,Z); GetPlayerFacingAngle(playerid,A); new filename[64]; format(filename,sizeof(filename),"SavedHousePositions.txt"); new File:fPlayerPosition=fopen(filename,io_append); new string[128]; format(string,sizeof(string),"%4.4f %4.4f %4.4f %4.4f Zone %d %s\r\n",X,Y,Z,A,GetPVarInt(playerid,"Zone"),Comment); fwrite(fPlayerPosition,string); fclose(fPlayerPosition); format(string,sizeof(string),"House Position saved (%f,%f,%f - %f). Zone: %d %s",X,Y,Z,A,GetPVarInt(playerid,"Zone"),Comment); SendClientMessageToAll(MSGDBUG_COLOR,string); return 1; }