Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Lorenc tools by Lorenc */
- #include <a_samp>
- #define COLOR_LIGHT_GREEN 0x00D67EFF
- #define COLOR_BLUE 0x00B7FFFF
- #define D1 1237
- #define D2 2352
- #define D3 2134
- #define D4 8472
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print(" Lorenc Tools by Lorenc loaded.");
- print("--------------------------------------\n");
- return 1;
- }
- public OnFilterScriptExit()
- {
- print("\n--------------------------------------");
- print(" Lorenc Tools by Lorenc deloaded.");
- print("--------------------------------------\n");
- return 1;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- if (strcmp("/loptions", cmdtext, true, 10) == 0) {
- if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_LIGHT_GREEN, "You need to be a rcon admin to use this command.");
- ShowPlayerDialog(playerid, D1, DIALOG_STYLE_LIST, "Lorenc's 3D Text, Map Icon & Pickup creator - Options", "Create a 3D Text here.\nCreate a Map Icon here\nCreate a pickup here", "Select", "Cancel");
- return 1;
- }
- return 0;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- if(dialogid == D1) {
- if(response) {
- if(listitem == 0) {
- /* 3D Text creator */
- ShowPlayerDialog(playerid,D2,DIALOG_STYLE_INPUT,"Lorenc's 3D Text creator","We will create a 3D text here but\nyou will need to input a message for the 3D Text.\n\nNote: The regular color that will be saved with this 3D Text is blue\nand the regular view distance is 20.","Accept","Decline");
- return 1;
- }
- if(listitem == 1) {
- /* Map icon maker */
- ShowPlayerDialog(playerid,D3,DIALOG_STYLE_INPUT,"Lorenc's Map Icon Creator","We will create the map icon here,\nhowever you will need to input a map icon id below:","Accept","Decline");
- return 1;
- }
- if(listitem == 2) {
- /* Pickup creator */
- ShowPlayerDialog(playerid,D4,DIALOG_STYLE_INPUT,"Lorenc's 3D Pickup creator","We will create the pickup here although\nyou will need to choose a pickup icon,\n\nList (Use numbers): \nHealth - 1240\nArmour - 1240\nInfo icon - 1239\nBlue house - 1272\nGreen house - 1273\nCash -1212\nAdrenaline - 1241\nBribe - 1247","Accept","Decline");
- return 1;
- }
- else
- {SendClientMessage(playerid, COLOR_LIGHT_GREEN, "You have canceled");}
- }
- }
- if(dialogid == D2) {
- if(response) {
- new string[126];
- new Float:X, Float:Y, Float:Z;
- GetPlayerPos(playerid, X, Y, Z);
- format(string, sizeof string, "%s",inputtext);
- Create3DTextLabel(string,COLOR_BLUE,X,Y,Z,20.0,0);
- new File:pos = fopen("3DTexts.LTOOLS", io_append);
- format(string, sizeof string, "Create3DTextLabel(\"%s\",0x00B7FFFF,%.2f, %.2f, %.2f,20.0,0); //3D Text created by Lorenc's 3D Text creator \r\n",inputtext, X, Y, Z);
- fwrite(pos, string);
- fclose(pos);
- SendClientMessage(playerid, COLOR_LIGHT_GREEN, string);
- SendClientMessage(playerid, COLOR_LIGHT_GREEN, "Your 3D Text has been saved to 3DTexts.LTOOLS.");
- }
- else {
- SendClientMessage(playerid, COLOR_LIGHT_GREEN, "You have canceled");
- }
- return 1;
- }
- if(dialogid == D3) {
- if(response) {
- if(IsNumeric(inputtext)) {
- new string[126];
- new Float:X, Float:Y, Float:Z;
- GetPlayerPos(playerid, X, Y, Z);
- SetPlayerMapIcon( playerid, 46, X, Y, Z, strval(inputtext), 0 );
- new File:pos2 = fopen("MapIcons.LTOOLS", io_append);
- format(string, sizeof string, "SetPlayerMapIcon(playerid, 46, %.2f, %.2f, %.2f, %i, 0); //Map icon created by Lorenc's Map icon creator \r\n", X, Y, Z, strval(inputtext));
- fwrite(pos2, string);
- fclose(pos2);
- SendClientMessage(playerid, COLOR_LIGHT_GREEN, string);
- SendClientMessage(playerid, COLOR_LIGHT_GREEN, "Map icon has been saved to the file MapIcons.LTOOLS.");
- }
- else {
- SendClientMessage(playerid, COLOR_LIGHT_GREEN, "Numbers Only!");
- ShowPlayerDialog(playerid,D3,DIALOG_STYLE_INPUT,"Lorenc's Map Icon Creator","The map icon will be saved at this location\nhowever you will need to input a map icon id below:","Accept","Decline");
- }
- }
- else {
- SendClientMessage(playerid, COLOR_LIGHT_GREEN, "You have canceled");
- }
- return 1;
- }
- if(dialogid == D4) {
- if(response) {
- if(IsNumeric(inputtext)) {
- new string[126];
- new Float:X, Float:Y, Float:Z;
- GetPlayerPos(playerid, X, Y, Z);
- AddStaticPickup(strval(inputtext), 1, X, Y, Z, 0);
- new File:pos3 = fopen("PickUps.LTOOLS", io_append);
- format(string, sizeof string, "AddStaticPickup(%i, 1, %.2f, %.2f, %.2f, 0); //Pickup created by Lorenc's pickup creator \r\n", strval(inputtext), X, Y, Z);
- fwrite(pos3, string);
- fclose(pos3);
- SendClientMessage(playerid, COLOR_LIGHT_GREEN, string);
- SendClientMessage(playerid, COLOR_LIGHT_GREEN, "Pickup has been saved to PickUps.LTOOLS");
- }
- else {
- SendClientMessage(playerid, COLOR_LIGHT_GREEN, "Numbers Only!");
- ShowPlayerDialog(playerid,D4,DIALOG_STYLE_INPUT,"Lorenc's 3D Pickup creator","We will create the pickup here although\nyou will need to choose a pickup icon,\n\nList (Use numbers): \nHealth - 1240\nArmour - 1240\nInfo icon - 1239\nBlue house - 1272\nGreen house - 1273\nCash -1212\nAdrenaline - 1241\nBribe - 1247","Accept","Decline");
- }
- }
- else {
- SendClientMessage(playerid, COLOR_LIGHT_GREEN, "You have canceled");
- }
- return 1;
- }
- return 1;
- }
- stock IsNumeric(string[])
- {
- for (new i = 0, j = strlen(string); i < j; i++) {
- if (string[i] > '9' || string[i] < '0') return 0;
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement