xqz

xqz

xqz
Dec 21st, 2013
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.79 KB | None | 0 0
  1. CMD:savehouse(playerid,params[])
  2. {
  3. if(IsPlayerAdmin(playerid))
  4. {
  5. new Float:X, Float:Y, Float:Z;
  6. new I;
  7. GetPlayerPos(playerid, X, Y, Z);
  8. I = GetPlayerInterior(playerid);
  9.  
  10. new comment[128];
  11. sscanf(params,"S("//")[128],comment))
  12. new File: fileid = fopen(SAVED_HOUSES_FILE, io_append);
  13. if(fileid)
  14. {
  15. new string[256];
  16. format(string, 256, "CreateHouse(%.2f, %.2f, %.2f, interiorX, interiorY, interiorZ, price, interior, %d, virtualworld); // %s\r\n", X, Y, Z, I, comment);
  17. fwrite(fileid, string);
  18. fclose(fileid);
  19. FS_MsgBox(playerid, "{33AA33}SUCCESS", "The house has been saved to \""SAVED_HOUSES_FILE"\"");
  20. }
  21. else FS_MsgBox(playerid, BOX_STYLE_ERROR, "An error has occurred! Maybe the directory doesn't exist.");
  22. return 1;
  23. }
  24. return 1;
  25. }
  26. CMD:savebiz(playerid,params[]) return cmd_savestore(playerid,params);
  27. CMD:saveshop(playerid,params[]) return cmd_savestore(playerid,params);
  28. CMD:savestore(playerid,params[])
  29. {
  30. if(IsPlayerAdmin(playerid))
  31. {
  32. new Float:X, Float:Y, Float:Z;
  33. new I;
  34. GetPlayerPos(playerid, X, Y, Z);
  35. I = GetPlayerInterior(playerid);
  36. new comment[128];
  37. sscanf(params,"S("//")[128],comment))
  38. new File: fileid = fopen(SAVED_SHOPS_FILE, io_append);
  39. if(fileid)
  40. {
  41. new string[256];
  42. format(string, 256, "CreateBusiness(title, earning, %.2f, %.2f, %.2f, interiorX, interiorY, interiorZ, price, interior, %d, virtualworld, iconmarker, item_list[]); // %s\r\n", X, Y, Z, I, comment);
  43. fwrite(fileid, string);
  44. fclose(fileid);
  45. FS_MsgBox(playerid, "{33AA33}SUCCESS", "The store has been saved to \""SAVED_SHOPS_FILE"\"");
  46. }
  47. else FS_MsgBox(playerid, BOX_STYLE_ERROR, "An error has occurred! Maybe the directory doesn't exist.");
  48. return 1;
  49. }
  50. }
  51. return 0;
  52. }
Advertisement
Add Comment
Please, Sign In to add comment