Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*=====================Ulric Map Icon & Pickup Creator=========================
- Credits to :
- - Dimas Rizward / Xaviour212
- - Dracoblue, for dcmd
- - Y_Less, for SSCANF
- ==============================================================================*/
- #include <a_samp>
- #include <sscanf>
- #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
- #define LIGHTRED 0xFF0000AA
- #define LIGHTBLUE 0x00C2ECFF
- #define LIGHTGREEN 0x38FF06FF
- public OnFilterScriptInit()
- {
- print("\n================================================");
- print(" Ulric Map Icon Creator & Pickup by Xaviour212");
- print("================================================\n");
- return 1;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- dcmd(creicon,7,cmdtext);
- dcmd(crepick,7,cmdtext);
- return 0;
- }
- dcmd_creicon(playerid, params[])
- {
- new str[256], string[100],icon, iconid;
- new Float:X, Float:Y, Float:Z;
- if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, LIGHTRED, "[ERROR]Only RCON admin can used this command");
- if(sscanf(params,"i",icon)) return SendClientMessage(playerid,LIGHTRED,"[ERROR]Use: /creicon [ModelID]");
- if(icon < 1 || icon > 63) return SendClientMessage(playerid, LIGHTRED, "[ERROR]Invalid Icon ID");
- GetPlayerPos(playerid, X, Y, Z);
- new File:Dom = fopen("MapIcon.txt", io_append);
- format(str, 256, "SetPlayerMapIcon(playerid, iconid, %f, %f, %f, %s, 0, MAPICON_LOCAL);//%s\r\n", X, Y, Z, params);
- fwrite(Dom, str);
- fclose(Dom);
- 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);
- SendClientMessage(playerid, LIGHTGREEN, string);
- SetPlayerMapIcon(playerid, iconid, X, Y, Z, icon, 0, MAPICON_LOCAL);
- return 1;
- }
- dcmd_crepick(playerid, params[])
- {
- new str[256], string[100], pickup, style;
- new Float:X, Float:Y, Float:Z;
- if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, LIGHTRED, "[ERROR]Only RCON admin can used this command");
- if(sscanf(params,"dd",pickup,style)) return SendClientMessage(playerid,LIGHTRED,"[ERROR]Use: /crepick [ModelID] [Style]");
- if(style < 0 || style > 23) return SendClientMessage(playerid, LIGHTRED, "[ERROR]Invalid Style");
- GetPlayerPos(playerid, X, Y, Z);
- new File:Dom = fopen("Pickup.txt", io_append);
- format(str, 256, "CreatePickup(%d, %d, %f, %f, %f, 0);\r\n", pickup, style, X, Y, Z);
- fwrite(Dom, str);
- fclose(Dom);
- 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);
- SendClientMessage(playerid, LIGHTGREEN, string);
- CreatePickup(pickup, style, X, Y, Z, 0);
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement