Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* EasyZone created by Mitosking for www.gta-center.com, an italian siteweb and forum of Grand Theft Auto.
- Thanks to Alby_Fire and Giovanni94m for helping me in difficult moment :).
- Original topic of this script: http://www.gta-center.com/forums/viewtopic.php?f=42&t=1094&p=11263#p11263
- Line: 197 (included this comment)
- Particolar Include: file.inc
- Time work: 2 hour*/
- #include <a_samp>
- // #if defined FILTERSCRIPT
- #define NOME 1526
- #define COLORE 1527
- #define TIPOCOLORE 1528
- #define HEX 1529
- #define rosso 0xff0000ff
- #define blu 0x0000ffff
- #define verde 0x00ff00ff
- #define verdescuro 0x009500ff
- #define rossoscuro 0xa00000ff
- #define bluscuro 0x0000a0ff
- #define nero 0x000000ff
- #define bianco 0xffffffff
- #define giallo 0xffff00ff
- #define arancione 0xffb100ff
- #define viola 0x974598ff
- #define azzurro 0x97c7ffff
- #define verdeacqua 0x00ffffff
- #define fuxia 0x90559bff
- #define marrone 0x905500ff
- #define rosachiaro 0xffd9ffff
- #define rosascuro 0xff58ffff
- new ZoneName[MAX_PLAYERS][128], bool: CreateZone[MAX_PLAYERS], Float: GangPos[MAX_PLAYERS][4], Step[MAX_PLAYERS], GFile[128], stringa[128], Colore[MAX_PLAYERS][128];
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print(" EasyZone by Mitosking LOADED.");
- print("--------------------------------------\n");
- if(!fexist("Crediti.txt"))
- {
- new File: crediti = fopen("Crediti.txt", io_write);
- fwrite(crediti, "EasyZone by Mitosking. Vietata la diffusione di questo FilterScript senza il mio permesso. FS creato per www.gta-center.com");
- fclose(crediti);
- }
- return 1;
- }
- public OnFilterScriptExit()
- {
- print("\n--------------------------------------");
- print(" EasyZone by Mitosking UNLOADED.");
- print("--------------------------------------\n");
- return 1;
- }
- // #else
- // #endif
- public OnPlayerConnect(playerid)
- {
- CreateZone[playerid] = false;
- Step[playerid] = 0;
- ZoneName[playerid] = "-1";
- GangPos[playerid][0] = -1;
- GangPos[playerid][1] = -1;
- GangPos[playerid][2] = -1;
- GangPos[playerid][3] = -1;
- return 1;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- if (strcmp("/creazona", cmdtext, true, 8) == 0)
- {
- if(!IsPlayerAdmin(playerid)) return 0;
- ShowPlayerDialog(playerid, NOME, 1, "EasyZone by Mitosking", "Inserisci il nome che vorresti dare alla tua GangZone", "Continua", "Annulla");
- return 1;
- }
- if (strcmp("/finezona", cmdtext, true, 8) == 0)
- {
- SendClientMessage(playerid, bianco, "Hai terminato la tua zona. Non è stato creato nessun file...");
- Step[playerid] = 0; CreateZone[playerid] = false;
- return 1;
- }
- return 0;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- if(dialogid == NOME && response)
- {
- if(!strlen(inputtext)) return SendClientMessage(playerid, rosso, "[ERRORE:]Devi inserire un nome per continuare!");
- format(GFile, 128, "%s.txt", inputtext);
- if(fexist(GFile)) return SendClientMessage(playerid, rosso, "[ERRORE:]Nome già esistente!");
- format(stringa, 128, "%s", inputtext);
- ZoneName[playerid] = stringa;
- ShowPlayerDialog(playerid, TIPOCOLORE, 2, "Scegli il tipo di colore", "Predefinito\nHex", "Continua", "Annulla");
- }
- if(dialogid == TIPOCOLORE && response)
- {
- switch(listitem)
- {
- case 0: ShowPlayerDialog(playerid, COLORE, 2, "Scegli il colore della tua Gang Zone", "{ff0000}Rosso\n{a00000}Rosso scuro\n{00ff00}Verde\n{009500}Verde scuro\n{0000ff}Blu\n{0000a0}Blu scuro\n{000000}Nero\n{ff92cc}Rosa\n{ff58ff}Rosa scuro\n{905500}Marrone\n{90559b}Fuxia\n{ffffff}Bianco\n{ffff00}Giallo\n{974598}Viola\n{97c7ff}Azzurro\n{ffb100}Arancione", "Continua", "Annulla");
- case 1: ShowPlayerDialog(playerid, HEX, 1, "Colore Hex", "Inserisci il codice Hex del tuo colore", "Continua", "Cancella");
- }
- }
- if(dialogid == HEX && response)
- {
- if(!strlen(inputtext))
- {
- ShowPlayerDialog(playerid, HEX, 1, "Colore Hex", "Inserisci il codice Hex del tuo colore", "Continua", "Cancella");
- SendClientMessage(playerid, rosso, "[ERROR:]Inserisci un codice Hex!");
- return 1;
- }
- format(stringa, 128, "%s", inputtext);
- Colore[playerid] = stringa;
- SendClientMessage(playerid, bianco, "Posizionati nell'angolo in {ff0000}basso a sinistra{ffffff}.");
- GameTextForPlayer(playerid, "~w~Premi ~r~~k~~VEHICLE_ENTER_EXIT~~w~ per memorizzare la posizione", 6300, 5);
- CreateZone[playerid] = true; Step[playerid] = 1;
- }
- if(dialogid == COLORE && response)
- {
- SendClientMessage(playerid, bianco, "Posizionati nell'angolo in {ff0000}basso a sinistra{ffffff}.");
- GameTextForPlayer(playerid, "~w~Premi ~r~~k~~VEHICLE_ENTER_EXIT~~w~ per memorizzare la posizione", 6300, 5);
- CreateZone[playerid] = true; Step[playerid] = 1;
- switch(listitem)
- {
- case 0: Colore[playerid] = "0xff0000ff";
- case 1: Colore[playerid] = "0xa00000ff";
- case 2: Colore[playerid] = "0x00ff00ff";
- case 3: Colore[playerid] = "0x009500ff";
- case 4: Colore[playerid] = "0x0000ffff";
- case 5: Colore[playerid] = "0x0000a0ff";
- case 6: Colore[playerid] = "0x000000ff";
- case 7: Colore[playerid] = "0xffd9ffff";
- case 8: Colore[playerid] = "0xff58ffff";
- case 9: Colore[playerid] = "0x905500ff";
- case 10: Colore[playerid] = "0x90559bff";
- case 11: Colore[playerid] = "0xffffffff";
- case 12: Colore[playerid] = "0xffff00ff";
- case 13: Colore[playerid] = "0x974598ff";
- case 14: Colore[playerid] = "0x97c7ffff";
- case 15: Colore[playerid] = "0xffb100ff";
- }
- }
- return 1;
- }
- public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
- {
- new Float: Pos[3]; GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
- if(newkeys == KEY_SECONDARY_ATTACK && CreateZone[playerid] == true && Step[playerid] == 1)
- {
- GangPos[playerid][0] = Pos[0];
- SendClientMessage(playerid, bianco, "Posizionati nell'angolo in {ff0000}alto a sinistra{ffffff}.");
- Step[playerid] ++;
- }
- else if(newkeys == KEY_SECONDARY_ATTACK && CreateZone[playerid] == true && Step[playerid] == 2)
- {
- GangPos[playerid][1] = Pos[1];
- SendClientMessage(playerid, bianco, "Posizionati nell'angolo in {ff0000}alto a destra{ffffff}.");
- Step[playerid] ++;
- }
- else if(newkeys == KEY_SECONDARY_ATTACK && CreateZone[playerid] == true && Step[playerid] == 3)
- {
- GangPos[playerid][3] = Pos[0];
- SendClientMessage(playerid, bianco, "Posizionati nell'angolo in {ff0000}basso a destra{ffffff}.");
- Step[playerid] ++;
- }
- else if(newkeys == KEY_SECONDARY_ATTACK && CreateZone[playerid] == true && Step[playerid] == 4)
- {
- GangPos[playerid][2] = Pos[1];
- format(stringa, 128, "Hai terminato la creazione della tua zona. Adesso recati nel file {ff0000}%s{ffffff} nella cartella {ff0000}scriptfiles", ZoneName[playerid]);
- SendClientMessage(playerid, bianco, stringa);
- format(GFile, 128, "%s.txt", ZoneName[playerid]);
- new File: zone = fopen(GFile, io_write);
- format(stringa, 128, "//In cima a tutto\r\nnew %s;", ZoneName[playerid]);
- fwrite(zone, stringa);
- format(stringa, 128, "\r\n//Sotto OnGameModeInit\r\n%s = GangZoneCreate(%f, %f, %f, %f);",ZoneName[playerid], GangPos[playerid][0], GangPos[playerid][1], GangPos[playerid][3], GangPos[playerid][2]);
- fwrite(zone, stringa);
- format(stringa, 128, "\r\n\r\n\r\n//GangZoneShowForPlayer(playerid, %s, %s) | GangZoneShowForAll(%s, %s) per rendere visibile la zona!", ZoneName[playerid], Colore[playerid], ZoneName[playerid], Colore[playerid]);
- fwrite(zone, stringa);
- fwrite(zone, "\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n//EasyZone by Mitosking. It's created for www.gta-center.com");
- Step[playerid] = 0;
- CreateZone[playerid] = false;
- fclose(zone);
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement