Guest User

Untitled

a guest
Nov 9th, 2011
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.39 KB | None | 0 0
  1. #include <a_samp>
  2. #include <sscanf>
  3.  
  4. #define dcmd(%1,%2,%3) if ((strcmp((%3)[1], #%1, true, (%2)) == 0) && ((((%3)[(%2) + 1] == 0) && (dcmd_%1(playerid, "")))||(((%3)[(%2) + 1] == 32) && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
  5.  
  6. #define LIGHTRED 0xFF0000AA
  7. #define LIGHTBLUE 0x00C2ECFF
  8. #define LIGHTGREEN 0x38FF06FF
  9.  
  10. public OnFilterScriptInit()
  11. {
  12. print("\n");
  13. print(" Script is working");
  14. print("\n");
  15. return 1;
  16. }
  17.  
  18. public OnPlayerCommandText(playerid, cmdtext[])
  19. {
  20. dcmd(creicon,7,cmdtext);
  21. dcmd(crepick,7,cmdtext);
  22.  
  23. return 0;
  24. }
  25.  
  26. dcmd_creicon(playerid, params[])
  27. {
  28. new str[256], string[100],icon, iconid;
  29. new Float:X, Float:Y, Float:Z;
  30. if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, LIGHTRED, "[ERROR]Only RCON admin can used this command");
  31. if(sscanf(params,"i",icon)) return SendClientMessage(playerid,LIGHTRED,"[ERROR]Use: /creicon [ModelID]");
  32. if(icon < 1 || icon > 63) return SendClientMessage(playerid, LIGHTRED, "[ERROR]Invalid Icon ID");
  33. GetPlayerPos(playerid, X, Y, Z);
  34. new File:Dom = fopen("MapIcon.txt", io_append);
  35. format(str, 256, "SetPlayerMapIcon(playerid, iconid, %f, %f, %f, %s, 0, MAPICON_LOCAL);//%s\r\n", X, Y, Z, params);
  36. fwrite(Dom, str);
  37. fclose(Dom);
  38. format(string, sizeof(string), "You has set map icon %s in %f, %f, %f. The file has been saved in MapIcon.txt", params, X, Y, Z);
  39. SendClientMessage(playerid, LIGHTGREEN, string);
  40. SetPlayerMapIcon(playerid, iconid, X, Y, Z, icon, 0, MAPICON_LOCAL);
  41. return 1;
  42. }
  43.  
  44. dcmd_crepick(playerid, params[])
  45. {
  46. new str[256], string[100], pickup, style;
  47. new Float:X, Float:Y, Float:Z;
  48. if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, LIGHTRED, "[ERROR]Only RCON admin can used this command");
  49. if(sscanf(params,"dd",pickup,style)) return SendClientMessage(playerid,LIGHTRED,"[ERROR]Use: /crepick [ModelID] [Style]");
  50. if(style < 0 || style > 23) return SendClientMessage(playerid, LIGHTRED, "[ERROR]Invalid Style");
  51. GetPlayerPos(playerid, X, Y, Z);
  52. new File:Dom = fopen("Pickup.txt", io_append);
  53. format(str, 256, "AddStaticPickup(%d, %d, %f, %f, %f, 0);\r\n", pickup, style, X, Y, Z);
  54. fwrite(Dom, str);
  55. fclose(Dom);
  56. format(string, sizeof(string), "You has set pickup %d in %f, %f, %f. The file has been saved in Pickup.txt", pickup, X, Y, Z);
  57. SendClientMessage(playerid, LIGHTGREEN, string);
  58. AddStaticPickup(pickup, style, X, Y, Z, 0);
  59. return 1;
  60. }
  61.  
Advertisement
Add Comment
Please, Sign In to add comment