Advertisement
Xaviour212

Ulric Map Icon & Pickup Creator

Apr 20th, 2011
1,075
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 2.77 KB | None | 0 0
  1. /*=====================Ulric Map Icon & Pickup Creator=========================
  2.     Credits to :
  3.         - Dimas Rizward / Xaviour212
  4.         - Dracoblue, for dcmd
  5.         - Y_Less, for SSCANF
  6. ==============================================================================*/
  7. #include <a_samp>
  8. #include <sscanf>
  9.  
  10. #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
  11.  
  12. #define LIGHTRED        0xFF0000AA
  13. #define LIGHTBLUE       0x00C2ECFF
  14. #define LIGHTGREEN      0x38FF06FF
  15.  
  16. public OnFilterScriptInit()
  17. {
  18.     print("\n================================================");
  19.     print(" Ulric Map Icon Creator & Pickup by Xaviour212");
  20.     print("================================================\n");
  21.     return 1;
  22. }
  23.  
  24. public OnPlayerCommandText(playerid, cmdtext[])
  25. {
  26.     dcmd(creicon,7,cmdtext);
  27.     dcmd(crepick,7,cmdtext);
  28.    
  29.     return 0;
  30. }
  31.  
  32. dcmd_creicon(playerid, params[])
  33. {
  34.     new str[256], string[100],icon, iconid;
  35.     new Float:X, Float:Y, Float:Z;
  36.     if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, LIGHTRED, "[ERROR]Only RCON admin can used this command");
  37.     if(sscanf(params,"i",icon)) return SendClientMessage(playerid,LIGHTRED,"[ERROR]Use: /creicon [ModelID]");
  38.     if(icon < 1 || icon > 63) return  SendClientMessage(playerid, LIGHTRED, "[ERROR]Invalid Icon ID");
  39.     GetPlayerPos(playerid, X, Y, Z);
  40.     new File:Dom = fopen("MapIcon.txt", io_append);
  41.     format(str, 256, "SetPlayerMapIcon(playerid, iconid, %f, %f, %f, %s, 0, MAPICON_LOCAL);//%s\r\n", X, Y, Z, params);
  42.     fwrite(Dom, str);
  43.     fclose(Dom);
  44.     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);
  45.     SendClientMessage(playerid, LIGHTGREEN, string);
  46.     SetPlayerMapIcon(playerid, iconid, X, Y, Z, icon, 0, MAPICON_LOCAL);
  47.     return 1;
  48. }
  49.  
  50. dcmd_crepick(playerid, params[])
  51. {
  52.     new str[256], string[100], pickup, style;
  53.     new Float:X, Float:Y, Float:Z;
  54.     if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, LIGHTRED, "[ERROR]Only RCON admin can used this command");
  55.     if(sscanf(params,"dd",pickup,style)) return SendClientMessage(playerid,LIGHTRED,"[ERROR]Use: /crepick [ModelID] [Style]");
  56.     if(style < 0 || style > 23) return  SendClientMessage(playerid, LIGHTRED, "[ERROR]Invalid Style");
  57.     GetPlayerPos(playerid, X, Y, Z);
  58.     new File:Dom = fopen("Pickup.txt", io_append);
  59.     format(str, 256, "CreatePickup(%d, %d, %f, %f, %f, 0);\r\n", pickup, style, X, Y, Z);
  60.     fwrite(Dom, str);
  61.     fclose(Dom);
  62.     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);
  63.     SendClientMessage(playerid, LIGHTGREEN, string);
  64.     CreatePickup(pickup, style, X, Y, Z, 0);
  65.     return 1;
  66. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement