Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- criado por NurbWill;
- Versão: 0.2b
- Skype: Nurb.Will
- Thanks
- Zeex for ZCMD
- Incognito for Streamer
- DOF2 for ...
- */
- #include <a_samp>
- #include <streamer>
- #include <zcmd>
- #include <dof2>
- #define GRAFITE_FOLDER "grafite/%s.ini"
- #define MAX_PLAYERS_TAGS (5) // Maximo de grafite tags criado por player.
- #define SPRAY_TAG_TIMER (4) // Segundos para criar a grafite tag.
- #define SPRAY_TAG_OBJECT (19353) // ID do objeto.
- #define SPRAY_TAG_OBJECT_DISTANCE (200.0) // Distância em que pode ser visto a grafite tag
- // ######### Tipo de diálogo personalizado #########
- #define TYPE_LIST_MENU (0)
- #define TYPE_LIST_EDIT (1)
- #define TYPE_LIST_CREATE (2)
- #define TYPE_LIST_TAGS (3)
- #define TYPE_LIST_TAGS_DELETE (4)
- #define TYPE_LIST_TAGS_CREATE (5)
- #define TYPE_LIST_TAGS_FIGND (6)
- // *********** ID de diálogo #########
- #define GRAFITE_MENU (9800)
- #define GRAFITE_DELETE (9801)
- #define GRAFITE_CREATE (9802)
- #define GRAFITE_CREATE_MAIN (9803)
- #define GRAFITE_CREATE_TEXT (9804)
- #define GRAFITE_CREATE_FONT (9805)
- #define GRAFITE_CREATE_SIZE (9806)
- #define GRAFITE_CREATE_COLOR (9807)
- #define GRAFITE_CREATE_FINISH (9808)
- #define GRAFITE_EDIT_MAIN (9809)
- #define GRAFITE_EDIT_TEXT (9810)
- #define GRAFITE_EDIT_FONT (9811)
- #define GRAFITE_EDIT_SIZE (9812)
- #define GRAFITE_EDIT_COLOR (9813)
- #define GRAFITE_EDIT_FINISH (9814)
- #define GRAFITE_EDIT_LIST (9815)
- #define GRAFITE_FIND (9816)
- #define GRAFITE_DIALOG_RETURN (9817)
- enum GRAFITE_DATA
- {
- _spSQLID,
- _spObject,
- _spText[50],
- _spOwned[MAX_PLAYER_NAME],
- _spFontColor,
- _spBold,
- _spFontSize,
- _spFont[50],
- Float:_spPosX,
- Float:_spPosY,
- Float:_spPosZ,
- Float:_spPosRX,
- Float:_spPosRY,
- Float:_spPosRZ,
- _spVW,
- _spInt
- }
- new
- GRAFITEs[MAX_PLAYERS][MAX_PLAYERS_TAGS][GRAFITE_DATA],
- GRAFITE_object[MAX_PLAYERS],
- GRAFITE_timer[MAX_PLAYERS],
- GRAFITE_timer_left[MAX_PLAYERS],
- GRAFITE_find[MAX_PLAYERS],
- GRAFITE_slot[MAX_PLAYERS],
- GRAFITE_text[MAX_PLAYERS],
- GRAFITE_size[MAX_PLAYERS],
- GRAFITE_bold[MAX_PLAYERS],
- GRAFITE_color[MAX_PLAYERS],
- GRAFITE_font[MAX_PLAYERS],
- Float:GRAFITE_positions[MAX_PLAYERS][6]
- ;
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print("Sistema de Grafite | Versão: 0.2b - By: Nurb Will;");
- print("--------------------------------------\n");
- return 1;
- }
- public OnFilterScriptExit()
- {
- DOF2_Exit();
- }
- public OnPlayerConnect(playerid)
- {
- Tag_Load(playerid);
- return 1;
- }
- forward GRAFITE_Dialog(iPlayerID, iType);
- public GRAFITE_Dialog(iPlayerID, iType)
- {
- new
- szDialog[500],
- szText[50],
- szFont[50],
- szBold[4],
- szColor[30]
- ;
- switch(iType)
- {
- case TYPE_LIST_MENU:
- {
- ShowPlayerDialog(iPlayerID, GRAFITE_MENU, DIALOG_STYLE_LIST, "{F7EC6F}Grafite Tag - {469BF0}Menu", "Criar Grafite tag\nEditar Grafite tag\nDeletar Grafite tag\nRastrear tag's", "Selecionar", "Sair");
- }
- case TYPE_LIST_CREATE:
- {
- switch(GRAFITE_bold[iPlayerID])
- {
- case 0: szBold = "Não";
- case 1: szBold = "Sim";
- }
- switch(GRAFITE_color[iPlayerID])
- {
- case -65536: szColor = "{FF0000}Vermelho";
- case -16468988: szColor = "{04B404}Verde";
- case -16730675: szColor = "{00B5CD}Azul Claro";
- case -256: szColor = "{FFFF00}Amarelo";
- case -16776961: szColor = "{0000FF}Azul";
- case -8092540: szColor = "{848484}Cinza";
- case -65281: szColor = "{FF00FF}Rosa";
- case -1: szColor = "{FFFFFF}Branco";
- }
- format(szText, 50, GRAFITE_text[iPlayerID]);
- format(szFont, 50, GRAFITE_font[iPlayerID]);
- format(szDialog, sizeof szDialog, "\
- {F7EC6F}Texto: %s\n\
- {F7EC6F}Fonte: %s\n\
- {F7EC6F}Tamanho: %d\n\
- {F7EC6F}Cor: %s\n\
- {F7EC6F}Negrito: %s\n\
- {FFB957}Criar Tag",
- szText,
- szFont,
- GRAFITE_size[iPlayerID],
- szColor,
- szBold
- );
- ShowPlayerDialog(iPlayerID, GRAFITE_CREATE_MAIN, DIALOG_STYLE_LIST, "{F7EC6F}Grafite Tag - {469BF0}Customizacao", szDialog, "Selecionar", "Voltar");
- }
- case TYPE_LIST_EDIT:
- {
- switch(GRAFITE_bold[iPlayerID])
- {
- case 0: szBold = "Nao";
- case 1: szBold = "Sim";
- }
- switch(GRAFITE_color[iPlayerID])
- {
- case -65536: szColor = "{FF0000}Vermelho";
- case -16468988: szColor = "{04B404}Verde";
- case -16730675: szColor = "{00B5CD}Azul Claro";
- case -256: szColor = "{FFFF00}Amarelo";
- case -16776961: szColor = "{0000FF}Azul";
- case -8092540: szColor = "{848484}Cinza";
- case -65281: szColor = "{FF00FF}Rosa";
- case -1: szColor = "{FFFFFF}Branco";
- }
- format(szDialog, sizeof szDialog, "\
- {F7EC6F}Texto: %s\n\
- {F7EC6F}Fonte: %s\n\
- {F7EC6F}Tamanho: %d\n\
- {F7EC6F}Cor: %s\n\
- {F7EC6F}Negrito: %s\n\
- {1EAAD9}Editar Tag",
- GRAFITE_text[iPlayerID],
- GRAFITE_font[iPlayerID],
- GRAFITE_size[iPlayerID],
- szColor,
- szBold
- );
- ShowPlayerDialog(iPlayerID, GRAFITE_EDIT_LIST, DIALOG_STYLE_LIST, "{F7EC6F}Grafite Tag - {469BF0}Customizacao", szDialog, "Selecionar", "Voltar");
- }
- case TYPE_LIST_TAGS:
- {
- new
- szName[MAX_PLAYER_NAME]
- ;
- GetPlayerName(iPlayerID, szName, sizeof szName);
- for(new i; i < MAX_PLAYERS_TAGS; i++)
- {
- new szTag[24];
- format(szTag, sizeof szTag, "{F7EC6F}Livre");
- if(GRAFITEs[iPlayerID][i][_spPosX] != 0.0 && GRAFITEs[iPlayerID][i][_spPosY] != 0.0)
- {
- format(szTag, sizeof(szTag), "{F7EC6F}Grafite Tag #%i", i);
- }
- format(szDialog, sizeof(szDialog), "%s%s\n", szDialog, szTag);
- }
- ShowPlayerDialog(iPlayerID, GRAFITE_EDIT_MAIN, DIALOG_STYLE_LIST, "{F7EC6F}Grafite Tag - {469BF0}Editar suas tag's", szDialog, "Selecionar", "Voltar");
- }
- case TYPE_LIST_TAGS_DELETE:
- {
- new
- szName[MAX_PLAYER_NAME]
- ;
- GetPlayerName(iPlayerID, szName, sizeof szName);
- for(new i; i < MAX_PLAYERS_TAGS; i++)
- {
- new szTag[24];
- format(szTag, sizeof szTag, "{F7EC6F}Livre");
- if(GRAFITEs[iPlayerID][i][_spPosX] != 0.0 && GRAFITEs[iPlayerID][i][_spPosY] != 0.0)
- {
- format(szTag, sizeof(szTag), "{F7EC6F}Grafite Tag #%i", i);
- }
- format(szDialog, sizeof(szDialog), "%s%s\n", szDialog, szTag);
- }
- ShowPlayerDialog(iPlayerID, GRAFITE_DELETE, DIALOG_STYLE_LIST, "{F7EC6F}Grafite Tag - {469BF0}Deletar suas tag's", szDialog, "Selecionar", "Voltar");
- }
- case TYPE_LIST_TAGS_CREATE:
- {
- new
- szName[MAX_PLAYER_NAME]
- ;
- GetPlayerName(iPlayerID, szName, sizeof szName);
- for(new i; i < MAX_PLAYERS_TAGS; i++)
- {
- new szTag[24];
- format(szTag, sizeof szTag, "{F7EC6F}Livre");
- if(GRAFITEs[iPlayerID][i][_spPosX] != 0.0 && GRAFITEs[iPlayerID][i][_spPosY] != 0.0)
- {
- format(szTag, sizeof(szTag), "{F7EC6F}Grafite Tag #%i", i);
- }
- format(szDialog, sizeof(szDialog), "%s%s\n", szDialog, szTag);
- }
- ShowPlayerDialog(iPlayerID, GRAFITE_CREATE, DIALOG_STYLE_LIST, "{F7EC6F}Grafite Tag - {469BF0}Selecione um slot livre", szDialog, "Selecionar", "Voltar");
- }
- case TYPE_LIST_TAGS_FIND:
- {
- new
- szName[MAX_PLAYER_NAME]
- ;
- GetPlayerName(iPlayerID, szName, sizeof szName);
- for(new i; i < MAX_PLAYERS_TAGS; i++)
- {
- new szTag[24];
- format(szTag, sizeof szTag, "{F7EC6F}Livre");
- if(GRAFITEs[iPlayerID][i][_spPosX] != 0.0 && GRAFITEs[iPlayerID][i][_spPosY] != 0.0)
- {
- format(szTag, sizeof(szTag), "{F7EC6F}Grafite Tag #%i", i);
- }
- format(szDialog, sizeof(szDialog), "%s%s\n", szDialog, szTag);
- }
- ShowPlayerDialog(iPlayerID, GRAFITE_FIND, DIALOG_STYLE_LIST, "{F7EC6F}Grafite Tag - {469BF0}Selecione a tag que voce deseja encontrar", szDialog, "Selecionar", "Voltar");
- }
- }
- return 1;
- }
- public OnPlayerEnterCheckpoint(playerid)
- {
- if(GRAFITE_find[playerid])
- {
- SendClientMessage(playerid, -1, "Voce chegou na sua Grafite tag.");
- DisablePlayerCheckpoint(playerid);
- }
- return 1;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- switch(dialogid)
- {
- case GRAFITE_DIALOG_RETURN: GRAFITE_Dialog(playerid, TYPE_LIST_MENU);
- case GRAFITE_MENU:
- {
- if(!response) return 1;
- switch(listitem)
- {
- case 0:
- {
- GRAFITE_Dialog(playerid, TYPE_LIST_TAGS_CREATE);
- }
- case 1: GRAFITE_Dialog(playerid, TYPE_LIST_TAGS);
- case 2: GRAFITE_Dialog(playerid, TYPE_LIST_TAGS_DELETE);
- case 3: GRAFITE_Dialog(playerid, TYPE_LIST_TAGS_FIND);
- }
- }
- case GRAFITE_EDIT_MAIN:
- {
- if(!response) return GRAFITE_Dialog(playerid, TYPE_LIST_MENU);
- if(GRAFITEs[playerid][listitem][_spPosX] == 0.0)
- return ShowPlayerDialog(playerid, GRAFITE_DIALOG_RETURN, DIALOG_STYLE_MSGBOX, "{F7EC6F}Grafite Tag - {BD0000} Ops!!", "Ops! Nao tem nada nesse slot.", "Ok", "");
- GRAFITE_slot[playerid] = listitem;
- GRAFITE_bold[playerid] = GRAFITEs[playerid][listitem][_spBold];
- GRAFITE_color[playerid] = GRAFITEs[playerid][listitem][_spFontColor];
- format(GRAFITE_text[playerid], 50, GRAFITEs[playerid][listitem][_spText]);
- format(GRAFITE_font[playerid], 50, GRAFITEs[playerid][listitem][_spFont]);
- GRAFITE_size[playerid] = GRAFITEs[playerid][listitem][_spFontSize];
- GRAFITE_Dialog(playerid, TYPE_LIST_EDIT);
- }
- case GRAFITE_DELETE:
- {
- if(!response) return GRAFITE_Dialog(playerid, TYPE_LIST_MENU);
- if(GRAFITEs[playerid][listitem][_spPosX] == 0.0)
- return ShowPlayerDialog(playerid, GRAFITE_DIALOG_RETURN, DIALOG_STYLE_MSGBOX, "{F7EC6F}Grafite Tag - {BD0000} Ops!!", "Ops! Nao tem nada nesse slot.", "Ok", "");
- new
- szMessage[60]
- ;
- Tags_Clear(playerid, listitem);
- format(szMessage, sizeof szMessage, "[Grafite Tag] A Grafite tag #%i foi deletada com sucesso.", listitem);
- SendClientMessage(playerid, -1, szMessage);
- GRAFITE_Dialog(playerid, TYPE_LIST_MENU);
- }
- case GRAFITE_FIND:
- {
- if(!response) return GRAFITE_Dialog(playerid, TYPE_LIST_MENU);
- if(GRAFITEs[playerid][listitem][_spPosX] == 0.0)
- return ShowPlayerDialog(playerid, GRAFITE_DIALOG_RETURN, DIALOG_STYLE_MSGBOX, "{F7EC6F}Grafite Tag - {BD0000} Ops!!", "Ops! Nao tem nada nesse slot.", "Ok", "");
- new
- szMessage[60]
- ;
- GRAFITE_find[playerid] = SetPlayerCheckpoint(playerid, GRAFITEs[playerid][listitem][_spPosX], GRAFITEs[playerid][listitem][_spPosY], GRAFITEs[playerid][listitem][_spPosZ], 3.0);
- format(szMessage, sizeof szMessage, "[Grafite Tag] Um checkpoint foi marcado na sua Grafite #%i.", listitem);
- SendClientMessage(playerid, -1, szMessage);
- }
- case GRAFITE_CREATE:
- {
- if(!response) return GRAFITE_Dialog(playerid, TYPE_LIST_MENU);
- if(GRAFITEs[playerid][listitem][_spPosX] == 0.0)
- {
- GRAFITE_slot[playerid] = listitem;
- format(GRAFITE_text[playerid], 50, "Exemplo");
- format(GRAFITE_font[playerid], 50, "Arial");
- GRAFITE_color[playerid] = -1;
- GRAFITE_size[playerid] = 24;
- GRAFITE_bold[playerid] = 0;
- GRAFITE_Dialog(playerid, TYPE_LIST_CREATE);
- } else ShowPlayerDialog(playerid, GRAFITE_DIALOG_RETURN, DIALOG_STYLE_MSGBOX, "{F7EC6F}Grafite Tag - {BD0000} Ops!!", "Ops! Este slot ja esta sendo usado.", "Ok", "");
- }
- case GRAFITE_EDIT_LIST:
- {
- if(!response) return GRAFITE_Dialog(playerid, TYPE_LIST_TAGS);
- new
- iIndex = GRAFITE_slot[playerid]
- ;
- switch(listitem)
- {
- case 0: ShowPlayerDialog(playerid, GRAFITE_EDIT_TEXT, DIALOG_STYLE_INPUT, "{F7EC6F}Grafite Tag - {469BF0}Texto", "Digite o texto que voce quer que aparece na Grafite Tag", "Selecionar", "Voltar");
- case 1: ShowPlayerDialog(playerid, GRAFITE_EDIT_FONT, DIALOG_STYLE_LIST, "{F7EC6F}Grafite Tag - {469BF0}Fonte", "Arial\nCourier\nImpact\nPricedown\nDaredevil\nBombing\naaaiight! fat\nFrom Street Art\nGhang\nGraffogie\nGraphers Blog\nNosegrind Demo", "Selecionar", "Voltar");
- case 2: ShowPlayerDialog(playerid, GRAFITE_EDIT_SIZE, DIALOG_STYLE_INPUT, "{F7EC6F}Grafite Tag - {469BF0}Tamanho", "Digite o tamanho que voce quer que aparece na Grafite Tag", "Selecionar", "Voltar");
- case 3: ShowPlayerDialog(playerid, GRAFITE_EDIT_COLOR, DIALOG_STYLE_LIST, "{F7EC6F}Grafite Tag - {469BF0}Cor", "{FF0000}Vermelho\n{04B404}Verde\n{00B5CD}Azul Claro\n{FFFF00}Amarelo\n{0000FF}Azul\n{848484}Cinza\n{FF00FF}Rosa\n{FFFFFF}Branco", "Selecionar", "Voltar");
- case 4:
- {
- switch(GRAFITE_bold[playerid])
- {
- case 0: GRAFITE_bold[playerid] = 1;
- case 1: GRAFITE_bold[playerid] = 0;
- }
- GRAFITE_Dialog(playerid, TYPE_LIST_EDIT);
- }
- case 5:
- {
- EditDynamicObject(playerid, GRAFITEs[playerid][iIndex][_spObject]);
- SetPVarInt(playerid, "GRAFITE_EDIT", 2);
- }
- }
- }
- case GRAFITE_EDIT_TEXT:
- {
- if(!response) return GRAFITE_Dialog(playerid, TYPE_LIST_EDIT);
- format(GRAFITE_text[playerid], 32, inputtext);
- GRAFITE_Dialog(playerid, TYPE_LIST_EDIT);
- }
- case GRAFITE_EDIT_FONT:
- {
- if(!response) return GRAFITE_Dialog(playerid, TYPE_LIST_EDIT);
- format(GRAFITE_font[playerid], 32, inputtext);
- GRAFITE_Dialog(playerid, TYPE_LIST_EDIT);
- }
- case GRAFITE_EDIT_SIZE:
- {
- if(!response) return GRAFITE_Dialog(playerid, TYPE_LIST_EDIT);
- GRAFITE_size[playerid] = strval(inputtext);
- GRAFITE_Dialog(playerid, TYPE_LIST_EDIT);
- }
- case GRAFITE_EDIT_COLOR:
- {
- if(!response) return GRAFITE_Dialog(playerid, TYPE_LIST_EDIT);
- new iColor;
- switch(listitem)
- {
- case 0: iColor = HexToInt("0xFFFF0000");
- case 1: iColor = HexToInt("0xFF04B404");
- case 2: iColor = HexToInt("0xFF00B5CD");
- case 3: iColor = HexToInt("0xFFFFFF00");
- case 4: iColor = HexToInt("0xFF0000FF");
- case 5: iColor = HexToInt("0xFF848484");
- case 6: iColor = HexToInt("0xFFFF00FF");
- case 7: iColor = HexToInt("0xFFFFFFFF");
- }
- GRAFITE_color[playerid] = iColor;
- GRAFITE_Dialog(playerid, TYPE_LIST_EDIT);
- }
- case GRAFITE_CREATE_MAIN:
- {
- if(!response) return GRAFITE_Dialog(playerid, TYPE_LIST_TAGS_CREATE);
- switch(listitem)
- {
- case 0: ShowPlayerDialog(playerid, GRAFITE_CREATE_TEXT, DIALOG_STYLE_INPUT, "{F7EC6F}Grafite Tag - {469BF0}Texto", "Digite o texto que voce quer que aparece na Grafite Tag", "Selecionar", "Voltar");
- case 1: ShowPlayerDialog(playerid, GRAFITE_CREATE_FONT, DIALOG_STYLE_LIST, "{F7EC6F}Grafite Tag - {469BF0}Fonte", "Arial\nCourier\nImpact\nPricedown\nDaredevil\nBombing\naaaiight! fat\nFrom Street Art\nGhang\nGraffogie\nGraphers Blog\nNosegrind Demo", "Selecionar", "Voltar");
- case 2: ShowPlayerDialog(playerid, GRAFITE_CREATE_SIZE, DIALOG_STYLE_INPUT, "{F7EC6F}Grafite Tag - {469BF0}Tamanho", "Digite o tamanho que voce quer que aparece na Grafite Tag", "Selecionar", "Voltar");
- case 3: ShowPlayerDialog(playerid, GRAFITE_CREATE_COLOR, DIALOG_STYLE_LIST, "{F7EC6F}Grafite Tag - {469BF0}Cor", "{FF0000}Vermelho\n{04B404}Verde\n{00B5CD}Azul Claro\n{FFFF00}Amarelo\n{0000FF}Azul\n{848484}Cinza\n{FF00FF}Rosa\n{FFFFFF}Branco", "Selecionar", "Voltar");
- case 4:
- {
- switch(GRAFITE_bold[playerid])
- {
- case 0: GRAFITE_bold[playerid] = 1;
- case 1: GRAFITE_bold[playerid] = 0;
- }
- GRAFITE_Dialog(playerid, TYPE_LIST_CREATE);
- }
- case 5:
- {
- new
- Float:Position[3],
- szText[50],
- szFont[50]
- ;
- GetPlayerPos(playerid, Position[0], Position[1], Position[2]);
- format(szText, 50, GRAFITE_text[playerid]);
- format(szFont, 50, GRAFITE_font[playerid]);
- GRAFITE_object[playerid] = CreateDynamicObject(SPRAY_TAG_OBJECT, Position[0]-1.0, Position[1], Position[2], 0.0, 0.0, 0.0, GetPlayerVirtualWorld(playerid), GetPlayerInterior(playerid), -1, SPRAY_TAG_OBJECT_DISTANCE);
- SetDynamicObjectMaterialText(GRAFITE_object[playerid], 0, szText, OBJECT_MATERIAL_SIZE_512x512, szFont, GRAFITE_size[playerid], GRAFITE_bold[playerid], GRAFITE_color[playerid], 0, 1);
- EditDynamicObject(playerid, GRAFITE_object[playerid]);
- SetPVarInt(playerid, "GRAFITE_EDIT", 1);
- }
- }
- }
- case GRAFITE_CREATE_TEXT:
- {
- if(!response) return GRAFITE_Dialog(playerid, TYPE_LIST_CREATE);
- format(GRAFITE_text[playerid], 50, inputtext);
- GRAFITE_Dialog(playerid, TYPE_LIST_CREATE);
- }
- case GRAFITE_CREATE_FONT:
- {
- if(!response) return GRAFITE_Dialog(playerid, TYPE_LIST_CREATE);
- format(GRAFITE_font[playerid], 50, inputtext);
- GRAFITE_Dialog(playerid, TYPE_LIST_CREATE);
- }
- case GRAFITE_CREATE_SIZE:
- {
- if(!response) return GRAFITE_Dialog(playerid, TYPE_LIST_CREATE);
- GRAFITE_size[playerid] = strval(inputtext);
- GRAFITE_Dialog(playerid, TYPE_LIST_CREATE);
- }
- case GRAFITE_CREATE_COLOR:
- {
- if(!response) return GRAFITE_Dialog(playerid, TYPE_LIST_CREATE);
- new iColor;
- switch(listitem)
- {
- case 0: iColor = HexToInt("0xFFFF0000");
- case 1: iColor = HexToInt("0xFF04B404");
- case 2: iColor = HexToInt("0xFF00B5CD");
- case 3: iColor = HexToInt("0xFFFFFF00");
- case 4: iColor = HexToInt("0xFF0000FF");
- case 5: iColor = HexToInt("0xFF848484");
- case 6: iColor = HexToInt("0xFFFF00FF");
- case 7: iColor = HexToInt("0xFFFFFFFF");
- }
- GRAFITE_color[playerid] = iColor;
- GRAFITE_Dialog(playerid, TYPE_LIST_CREATE);
- }
- }
- return 1;
- }
- public OnPlayerEditDynamicObject(playerid, objectid, response, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz)
- {
- if(response == EDIT_RESPONSE_FINAL)
- {
- if(GetPVarInt(playerid, "GRAFITE_EDIT") == 1)
- {
- if(!IsPlayerInRangeOfPoint(playerid, 3, x, y, z))
- {
- DestroyDynamicObject(GRAFITE_object[playerid]);
- DeletePVar(playerid, "GRAFITE_EDIT");
- return SendClientMessage(playerid, -1, "Voce nao esta perto da Grafite tag.");
- }
- GRAFITE_positions[playerid][0] = x;
- GRAFITE_positions[playerid][1] = y;
- GRAFITE_positions[playerid][2] = z;
- GRAFITE_positions[playerid][3] = rx;
- GRAFITE_positions[playerid][4] = ry;
- GRAFITE_positions[playerid][5] = rz;
- GRAFITE_timer[playerid] = SetTimerEx("GRAFITE", 1000, true, "ii", playerid, 2);
- ApplyAnimation(playerid, "SPRAYCAN", "spraycan_full", 4.0, 1, 1, 1, 0, 0, 1);
- GRAFITE_timer_left[playerid] = SPRAY_TAG_TIMER;
- DestroyDynamicObject(GRAFITE_object[playerid]);
- }
- if(GetPVarInt(playerid, "GRAFITE_EDIT") == 2)
- {
- new
- iIndex = GRAFITE_slot[playerid]
- ;
- if(!IsPlayerInRangeOfPoint(playerid, 3, x, y, z))
- {
- DestroyDynamicObject(GRAFITEs[playerid][iIndex][_spObject]);
- GRAFITE_Spawn(playerid, iIndex);
- DeletePVar(playerid, "GRAFITE_EDIT");
- return SendClientMessage(playerid, -1, "Voce nao esta perto da Grafite tag.");
- }
- GRAFITE_positions[playerid][0] = x;
- GRAFITE_positions[playerid][1] = y;
- GRAFITE_positions[playerid][2] = z;
- GRAFITE_positions[playerid][3] = rx;
- GRAFITE_positions[playerid][4] = ry;
- GRAFITE_positions[playerid][5] = rz;
- GRAFITE_timer[playerid] = SetTimerEx("GRAFITE", 1000, true, "ii", playerid, 1);
- ApplyAnimation(playerid, "SPRAYCAN", "spraycan_full", 4.0, 1, 1, 1, 0, 0, 1);
- GRAFITE_timer_left[playerid] = SPRAY_TAG_TIMER;
- DestroyDynamicObject(GRAFITEs[playerid][iIndex][_spObject]);
- }
- }
- if(response == EDIT_RESPONSE_CANCEL)
- {
- if(GetPVarInt(playerid, "GRAFITE_EDIT") >= 1)
- {
- DestroyDynamicObject(GRAFITE_object[playerid]);
- DestroyDynamicObject(GRAFITEs[playerid][GRAFITE_slot[playerid]][_spObject]);
- GRAFITE_Spawn(playerid, GRAFITE_slot[playerid]);
- DeletePVar(playerid, "GRAFITE_EDIT");
- }
- }
- return 1;
- }
- forward GRAFITE(playerid, type);
- public GRAFITE(playerid, type)
- {
- new
- iIndex = GRAFITE_slot[playerid]
- ;
- if(!IsPlayerConnected(playerid))
- {
- GRAFITE_timer_left[playerid] = 0;
- DeletePVar(playerid, "GRAFITE_EDIT");
- KillTimer(GRAFITE_timer[playerid]);
- return 1;
- }
- GRAFITE_timer_left[playerid]--;
- switch(type)
- {
- case 1:
- {
- if(GRAFITE_timer_left[playerid] == 0)
- {
- DestroyDynamicObject(GRAFITEs[playerid][iIndex][_spObject]);
- DestroyDynamicObject(GRAFITE_object[playerid]);
- format(GRAFITEs[playerid][iIndex][_spText], 50, GRAFITE_text[playerid]);
- format(GRAFITEs[playerid][iIndex][_spFont], 50, GRAFITE_font[playerid]);
- GRAFITEs[playerid][iIndex][_spPosX] = GRAFITE_positions[playerid][0];
- GRAFITEs[playerid][iIndex][_spPosY] = GRAFITE_positions[playerid][1];
- GRAFITEs[playerid][iIndex][_spPosZ] = GRAFITE_positions[playerid][2];
- GRAFITEs[playerid][iIndex][_spPosRX] = GRAFITE_positions[playerid][3];
- GRAFITEs[playerid][iIndex][_spPosRY] = GRAFITE_positions[playerid][4];
- GRAFITEs[playerid][iIndex][_spPosRZ] = GRAFITE_positions[playerid][5];
- GRAFITEs[playerid][iIndex][_spFontColor] = GRAFITE_color[playerid];
- GRAFITEs[playerid][iIndex][_spFontSize] = GRAFITE_size[playerid];
- GRAFITEs[playerid][iIndex][_spBold] = GRAFITE_bold[playerid];
- GRAFITE_Spawn(playerid, iIndex);
- Tags_Save(playerid, iIndex);
- ClearAnimations(playerid);
- ApplyAnimation(playerid, "GRAFFITI", "graffiti_Chkout", 4.0, 0, 0, 0, 0, 0, 1);
- KillTimer(GRAFITE_timer[playerid]);
- }
- }
- case 2:
- {
- if(GRAFITE_timer_left[playerid] == 0)
- {
- GRAFITE_Create(playerid, GRAFITE_slot[playerid]);
- ClearAnimations(playerid);
- ApplyAnimation(playerid, "GRAFFITI", "graffiti_Chkout", 4.0, 0, 0, 0, 0, 0, 1);
- KillTimer(GRAFITE_timer[playerid]);
- }
- }
- }
- DeletePVar(playerid, "GRAFITE_EDIT");
- return 1;
- }
- CMD:criargrafite(playerid)
- {
- if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "{ff2400}>> Voce nao esta logado por RCON");
- if(IsPlayerConnected(playerid)) GRAFITE_Dialog(playerid, TYPE_LIST_MENU);
- return 1;
- }
- stock GRAFITE_Create(playerid, iIndex)
- {
- if(IsPlayerConnected(playerid))
- {
- new
- szMessage[128]
- ;
- GRAFITEs[playerid][iIndex][_spPosX] = GRAFITE_positions[playerid][0];
- GRAFITEs[playerid][iIndex][_spPosY] = GRAFITE_positions[playerid][1];
- GRAFITEs[playerid][iIndex][_spPosZ] = GRAFITE_positions[playerid][2];
- GRAFITEs[playerid][iIndex][_spPosRX] = GRAFITE_positions[playerid][3];
- GRAFITEs[playerid][iIndex][_spPosRY] = GRAFITE_positions[playerid][4];
- GRAFITEs[playerid][iIndex][_spPosRZ] = GRAFITE_positions[playerid][5];
- format(GRAFITEs[playerid][iIndex][_spText], 50, GRAFITE_text[playerid]);
- format(GRAFITEs[playerid][iIndex][_spFont], 50, GRAFITE_font[playerid]);
- GRAFITEs[playerid][iIndex][_spFontColor] = GRAFITE_color[playerid];
- GRAFITEs[playerid][iIndex][_spFontSize] = GRAFITE_size[playerid];
- GRAFITEs[playerid][iIndex][_spBold] = GRAFITE_bold[playerid];
- GRAFITE_Spawn(playerid, iIndex);
- Tags_Save(playerid, iIndex);
- format(szMessage, sizeof szMessage, "[Grafite Tag] Voce criou uma Grafite tag com ID # %i.", iIndex);
- SendClientMessage(playerid, -1, szMessage);
- }
- }
- stock GRAFITE_Spawn(playerid, iIndex)
- {
- GRAFITEs[playerid][iIndex][_spObject] = CreateDynamicObject(SPRAY_TAG_OBJECT, GRAFITEs[playerid][iIndex][_spPosX], GRAFITEs[playerid][iIndex][_spPosY], GRAFITEs[playerid][iIndex][_spPosZ], GRAFITEs[playerid][iIndex][_spPosRX], GRAFITEs[playerid][iIndex][_spPosRY], GRAFITEs[playerid][iIndex][_spPosRZ], GRAFITEs[playerid][iIndex][_spVW], GRAFITEs[playerid][iIndex][_spInt], -1, SPRAY_TAG_OBJECT_DISTANCE);
- SetDynamicObjectMaterialText(GRAFITEs[playerid][iIndex][_spObject], 0, GRAFITEs[playerid][iIndex][_spText], OBJECT_MATERIAL_SIZE_512x512, GRAFITEs[playerid][iIndex][_spFont], GRAFITEs[playerid][iIndex][_spFontSize], GRAFITEs[playerid][iIndex][_spBold], GRAFITEs[playerid][iIndex][_spFontColor], 0, 1);
- return 1;
- }
- stock Tag_Load(playerid)
- {
- if(IsPlayerConnected(playerid))
- {
- new
- szFile[40],
- szLine[28],
- szName[MAX_PLAYER_NAME]
- ;
- GetPlayerName(playerid, szName, MAX_PLAYER_NAME);
- format(szFile, 40, GRAFITE_FOLDER, szName);
- for(new i; i < MAX_PLAYERS_TAGS; i++)
- {
- format(szLine, sizeof szLine, "Text%i", i); format(GRAFITEs[playerid][i][_spText], 50, DOF2_GetString(szFile, szLine));
- format(szLine, sizeof szLine, "Font%i", i); format(GRAFITEs[playerid][i][_spFont], 50, DOF2_GetString(szFile, szLine));
- format(szLine, sizeof szLine, "FontSize%i", i); GRAFITEs[playerid][i][_spFontSize] = DOF2_GetInt(szFile, szLine);
- format(szLine, sizeof szLine, "FontBold%i", i); GRAFITEs[playerid][i][_spBold] = DOF2_GetInt(szFile, szLine);
- format(szLine, sizeof szLine, "FontColor%i", i); GRAFITEs[playerid][i][_spFontColor] = DOF2_GetInt(szFile, szLine);
- format(szLine, sizeof szLine, "PosX%i", i); GRAFITEs[playerid][i][_spPosX] = DOF2_GetFloat(szFile, szLine);
- format(szLine, sizeof szLine, "PosY%i", i); GRAFITEs[playerid][i][_spPosY] = DOF2_GetFloat(szFile, szLine);
- format(szLine, sizeof szLine, "PosZ%i", i); GRAFITEs[playerid][i][_spPosZ] = DOF2_GetFloat(szFile, szLine);
- format(szLine, sizeof szLine, "RotX%i", i); GRAFITEs[playerid][i][_spPosRX] = DOF2_GetFloat(szFile, szLine);
- format(szLine, sizeof szLine, "RotY%i", i); GRAFITEs[playerid][i][_spPosRY] = DOF2_GetFloat(szFile, szLine);
- format(szLine, sizeof szLine, "RotZ%i", i); GRAFITEs[playerid][i][_spPosRZ] = DOF2_GetFloat(szFile, szLine);
- format(szLine, sizeof szLine, "VirtualWorld%i", i); GRAFITEs[playerid][i][_spVW] = DOF2_GetInt(szFile, szLine);
- format(szLine, sizeof szLine, "Interior%i", i); GRAFITEs[playerid][i][_spInt] = DOF2_GetInt(szFile, szLine);
- if(GRAFITEs[playerid][i][_spPosX] != 0.0)
- {
- GRAFITE_Spawn(playerid, i);
- }
- }
- }
- return 1;
- }
- stock Tags_Clear(playerid, iIndex)
- {
- format(GRAFITEs[playerid][iIndex][_spText], 50, "Exemplo");
- format(GRAFITEs[playerid][iIndex][_spFont], 50, "Arial");
- GRAFITEs[playerid][iIndex][_spFontSize] = 24;
- GRAFITEs[playerid][iIndex][_spBold] = 0;
- GRAFITEs[playerid][iIndex][_spFontColor] = -1;
- GRAFITEs[playerid][iIndex][_spPosX] = 0.0;
- GRAFITEs[playerid][iIndex][_spPosY] = 0.0;
- GRAFITEs[playerid][iIndex][_spPosZ] = 0.0;
- GRAFITEs[playerid][iIndex][_spPosRX] = 0.0;
- GRAFITEs[playerid][iIndex][_spPosRY] = 0.0;
- GRAFITEs[playerid][iIndex][_spPosRZ] = 0.0;
- GRAFITEs[playerid][iIndex][_spVW] = 0;
- GRAFITEs[playerid][iIndex][_spInt] = 0;
- DestroyDynamicObject(GRAFITEs[playerid][iIndex][_spObject]);
- Tags_Save(playerid, iIndex);
- return 1;
- }
- stock Tags_Save(playerid, iIndex)
- {
- if(IsPlayerConnected(playerid))
- {
- new
- szFile[32],
- szLine[128],
- szName[MAX_PLAYER_NAME]
- ;
- GetPlayerName(playerid, szName, MAX_PLAYER_NAME);
- format(szFile, 32, GRAFITE_FOLDER, szName);
- if(!DOF2_FileExists(szFile)) DOF2_CreateFile(szFile);
- {
- format(szLine, sizeof szLine, "Text%i", iIndex); DOF2_SetString(szFile, szLine, GRAFITEs[playerid][iIndex][_spText]);
- format(szLine, sizeof szLine, "Font%i", iIndex); DOF2_SetString(szFile, szLine, GRAFITEs[playerid][iIndex][_spFont]);
- format(szLine, sizeof szLine, "FontSize%i", iIndex); DOF2_SetInt(szFile, szLine, GRAFITEs[playerid][iIndex][_spFontSize]);
- format(szLine, sizeof szLine, "FontBold%i", iIndex); DOF2_SetInt(szFile, szLine, GRAFITEs[playerid][iIndex][_spBold]);
- format(szLine, sizeof szLine, "FontColor%i", iIndex); DOF2_SetInt(szFile, szLine, GRAFITEs[playerid][iIndex][_spFontColor]);
- format(szLine, sizeof szLine, "PosX%i", iIndex); DOF2_SetFloat(szFile, szLine, GRAFITEs[playerid][iIndex][_spPosX]);
- format(szLine, sizeof szLine, "PosY%i", iIndex); DOF2_SetFloat(szFile, szLine, GRAFITEs[playerid][iIndex][_spPosY]);
- format(szLine, sizeof szLine, "PosZ%i", iIndex); DOF2_SetFloat(szFile, szLine, GRAFITEs[playerid][iIndex][_spPosZ]);
- format(szLine, sizeof szLine, "RotX%i", iIndex); DOF2_SetFloat(szFile, szLine, GRAFITEs[playerid][iIndex][_spPosRX]);
- format(szLine, sizeof szLine, "RotY%i", iIndex); DOF2_SetFloat(szFile, szLine, GRAFITEs[playerid][iIndex][_spPosRY]);
- format(szLine, sizeof szLine, "RotZ%i", iIndex); DOF2_SetFloat(szFile, szLine, GRAFITEs[playerid][iIndex][_spPosRZ]);
- format(szLine, sizeof szLine, "VirtualWorld%i", iIndex); DOF2_SetInt(szFile, szLine, GRAFITEs[playerid][iIndex][_spVW]);
- format(szLine, sizeof szLine, "Interior%i", iIndex); DOF2_SetInt(szFile, szLine, GRAFITEs[playerid][iIndex][_spInt]);
- DOF2_SaveFile();
- }
- }
- return 1;
- }
- stock HexToInt(string[]) // Criando by Zamaroth!!
- {
- if (string[0] == 0) return 0;
- new
- i,
- cur = 1,
- res = 0
- ;
- for (i = strlen(string); i > 0; i --) {
- if (string[i-1] < 58) res = res + cur * (string[i-1]-48); else res = res + cur * (string[i-1]-65+10);
- cur = cur * 16;
- }
- return res;
- }
Add Comment
Please, Sign In to add comment