Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- ***********************
- ** By Eduardo AC **
- ***********************
- Callbacks:
- * Chamada ao criar um inventario
- OnCreateInventory(Inventory:id)
- * Chamada ao criar um inventário estático (posicionado no mapa)
- OnCreateStaticInventory(Inventory:id, Float:x, Float:y, Float:z, virtual_world, interior, destroy_delay, Inventory:copy_id)
- * Chamada quando um inventário é destruído
- OnDestroyInventory(Inventory:id, bool:static_inventory)
- * Chamada quando o joagdor abre um inventário
- OnPlayerOpenInventory(playerid, Inventory:id)
- * Chamada quando o jogador fecha o inventário
- OnPlayerCloseInventory(playerid, Inventory:id)
- * Chamada quando um inventário é destruído, porém um jogador está com ele aberto
- OnDestroyOpenedInventory(playerid, Inventory:id)
- * Chamada quando o jogador clica em um item
- OnPlayerSelectItem(playerid, Inventory:id, item, type_index, index)
- * Chamada quando o jogador usa um item
- OnPlayerUseItem(playerid, Inventory:id, item, type_index, index)
- * Chamada quando o jogador solta um item
- OnPlayerDropItem(playerid, Inventory:id, item, type_index, index)
- * Chamada quando um item é removido do inventário (através da função RemoveInventoryItem apenas)
- OnRemoveInventoryItem(Inventory:id, item, type_index, amount)
- * Chamada quando o jogador pega um item do chão
- OnPlayerGetDropedItem(playerid, dropped_index, item, type_index, amount)
- ----------------------------------------------------------------------
- Funções:
- * Cria e inicializa o inventário do jogador (sempre usar esta função antes de qualquer outra para o jogador)
- Inventory:CreatePlayerInventory(playerid)
- * Cria um inventário estático
- Inventory:CreateStaticInventory(Float:x, Float:y, Float:z, max_items = MAX_INVENTORY_ITEMS, vw = -1, interior = -1, modelid = -1, Float:rx = 0.0, Float:ry = 0.0, Float:rz = 0.0, const label_text[] = "", destroy_delay = 0, Inventory:id = INVALID_INVENTORY_ID)
- * Cria um inventário
- Inventory:CreateInventory(Inventory:id = INVALID_INVENTORY_ID, max_items = MAX_INVENTORY_ITEMS)
- * Pega o inventário que o jogador está visualizando
- Inventory:GetPlayerOpenedInventory(playerid)
- * Adiciona um novo item ao conjunto de itens existentes de inventário
- AddNewInventoryItem(item, type_index, const title[], const description[])
- * Adiciona um novo item ao inventário
- AddItemInventory(Inventory:id, item, type_index, amount, index = -1)
- * Retorna por referência o id, tipo e quantidade do item através do index no inventário
- InfoInventoryItem(Inventory:id, index, &item, &type_index, &amount)
- * Retorna o inventário estático mais próximo do jogador com base em determinada área
- Inventory:GetStaticInventoryNearPlayer(playerid, Float:range)
- * Retorna a quantidade do item através do index no inventário
- GetInventoryIndexAmount(Inventory:id, index)
- * Retorna a quantidade do item através do id do item e tipo no inventário
- GetInventoryItemAmount(Inventory:id, item, type_index)
- * Retorna por referência o título e descrição de determinado item através do id e tipo
- ItemInfo(item, type_index, title[], description[])
- * Remove um item do inventário através do item, tipo e determinada quantidade (-1 remove tudo)
- RemoveInventoryItem(Inventory:id, item, type_index, amount = -1)
- * Remove um item do inventário com base no index no inventário
- RemoveInventoryItemIndex(Inventory:id, index)
- * Retorna se o jogador possui determinado item
- HaveInventoryItem(Inventory:id, item, type_index)
- * Reseta os itens do inventário
- ClearInventory(Inventory:id)
- * Retorna se o inventário é válido
- IsValidInventory(Inventory:id)
- * Retorna se o inventário é estático
- IsStaticInventory(Inventory:id)
- * Retorna se o inventário é temporário (auto-destrói)
- IsTemporaryInventory(Inventory:id)
- * Retorna a quantidade de itens do inventário
- CountInventoryItems(Inventory:id)
- * Define a quantidade máxima de itens do inventário
- SetInventoryMaxItems(Inventory:id, max_items)
- * Retorna a quantidade máxima de itens do inventário
- GetInventoryMaxItems(Inventory:id)
- * Retorna o index do último item válido do inventário
- GetLastInventoryItemIndex(Inventory:id)
- * Retorna se o item é válido (caso ele não exista mais no servidor e o jogador ainda o possua)
- IsValidInventoryItem(item, type_index)
- * Retorna o index do item com base no id e tipo
- GetInventoryItemIndex(Inventory:id, item, type_index)
- * Cria um item no chão
- CreateDropItem(item, type_index, amount, Float:x, Float:y, Float:z, Float:rx = 0.0, Float:ry = 0.0, Float:rz = 0.0, vw = -1, interior = -1)
- * Remove um item do chão
- RemoveDroppedItem(dropped_index)
- * Retorna o número de itens no chão com base no id e tipo
- CountDroppedItem(item, type_index = 0)
- * Retorna o número de itens no chão
- CountDroppedItems()
- * Mostra o inventário para o jogador
- ShowInventory(Inventory:id, playerid, page = 1, bool:button_use = true, bool:button_drop = true)
- * Mostra a aba de informações do item (título, descrição, icone e botões)
- ShowInventoryItemInfo(playerid)
- * Oculta a aba de informações do item (título, descrição, icone e botões)
- HideInventoryItemInfo(playerid)
- * Oculta o inventário para o jogador (automaticamente oculta a aba de informações do item)
- HideInventory(playerid)
- * Destrói o inventário
- DestroyInventory(Inventory:id)
- */
- #define INVENTORY_LABEL_STREAM 10.0
- #define OPEN_INVENTORY_KEY KEY_YES
- #define GET_INVENTORY_ITEM_KEY KEY_YES
- #define MAX_SERVER_INVENTORY MAX_PLAYERS * 5 + 200
- #define MAX_INTERNAL_INVENTORY_ITEMS 120 // Número máximo de itens de inventário
- #define MAX_SERVER_DROPPED_ITEMS 10000 // Número máximo de objetos soltos no mapa
- #define MAX_INVENTORY_ITEMS 12 * 2 // Cada página contém 12 itens
- #define MAX_INVENTORY_SUBITEMS 5 // Número máximo de subitens por item
- #define MAX_INVENTORY_TITLE 30 // Número máximo de caracteres do título
- #define MAX_INVENTORY_DESCRIPTION 50 // Número máximo de caracteres da descrição
- #define INVALID_INVENTORY_ID Inventory:-1
- #define INVALID_INVENTORY_ITEM -1 // ID do objeto que vai definir os itens inválidos
- enum E_INVENTARIO_ITENS_DATA
- {
- ObjectModel,
- TypeIndex,
- ItemTitle[MAX_INVENTORY_TITLE],
- ItemDescription[MAX_INVENTORY_DESCRIPTION]
- }
- static __tempInventoryItems[MAX_INTERNAL_INVENTORY_ITEMS][E_INVENTARIO_ITENS_DATA];
- //static PlayerText:InvTD[MAX_PLAYERS][35];
- new Text:__globalInvTD[7];
- new PlayerText:__playerInvTD[MAX_PLAYERS][28];
- static bool:__tempInvAtivo[MAX_PLAYERS];
- static bool:__tempBotaoUsar[MAX_PLAYERS];
- static bool:__tempBotaoSoltar[MAX_PLAYERS];
- static __tempNoInventario[MAX_PLAYERS] = { _:INVALID_INVENTORY_ID, ... };
- static __tempPaginaInicial[MAX_PLAYERS] = { -1, ... };
- static __tempPaginaSelecionada[MAX_PLAYERS];
- static __tempItemSelecionado[MAX_PLAYERS] = { -1, ... };
- static __tempTextdrawSelecionada[MAX_PLAYERS] = { INVALID_TEXT_DRAW, ... };
- enum E_INVENTARIO_DATA
- {
- ObjectModel,
- TypeIndex,
- Amount,
- ItemTitle[20],
- ItemDescription[MAX_INVENTORY_DESCRIPTION],
- }
- static InventoryData[MAX_SERVER_INVENTORY][MAX_INVENTORY_ITEMS][E_INVENTARIO_DATA];
- enum E_INVENTARIO_SERVER_DATA
- {
- ID,
- bool:Static,
- ObjectID,
- MaxItems,
- Text3D:Label,
- ObjectModel,
- Float:PosX,
- Float:PosY,
- Float:PosZ,
- VirtualWorld,
- Interior,
- TimerDestroy
- }
- static Inv[MAX_SERVER_INVENTORY][E_INVENTARIO_SERVER_DATA];
- // Itens no chão
- static DroppedServerItemData[MAX_SERVER_DROPPED_ITEMS][E_INVENTARIO_DATA];
- static Float:DroppedServerItemDataPos[MAX_SERVER_DROPPED_ITEMS][3];
- static __tempServerObjectItem[MAX_SERVER_DROPPED_ITEMS] = {INVALID_OBJECT_ID, ...};
- static Text3D:__tempServerObjectLabel[MAX_SERVER_DROPPED_ITEMS];
- forward OnCreateInventory(Inventory:id);
- forward OnCreateStaticInventory(Inventory:id, Float:x, Float:y, Float:z, virtual_world, interior, destroy_delay, Inventory:copy_id);
- forward OnDestroyInventory(Inventory:id, bool:static_inventory);
- forward OnPlayerOpenInventory(playerid, Inventory:id);
- forward OnPlayerCloseInventory(playerid, Inventory:id);
- forward OnDestroyOpenedInventory(playerid, Inventory:id);
- forward OnPlayerSelectItem(playerid, Inventory:id, item, type_index, index);
- forward OnPlayerUseItem(playerid, Inventory:id, item, type_index, index);
- forward OnPlayerDropItem(playerid, Inventory:id, item, type_index, index);
- forward OnRemoveInventoryItem(Inventory:id, item, type_index, amount);
- forward OnPlayerGetDropedItem(playerid, dropped_index, item, type_index, amount);
- public OnGameModeInit()
- {
- for(new i = 0; i < MAX_INTERNAL_INVENTORY_ITEMS; i ++)
- __tempInventoryItems[i][ObjectModel] = INVALID_INVENTORY_ITEM;
- for(new i = 0; i < MAX_SERVER_DROPPED_ITEMS; i ++)
- DroppedServerItemData[i][ObjectModel] = INVALID_INVENTORY_ITEM;
- CreateInventoryTD();
- #if defined td_invent_OnGameModeInit
- td_invent_OnGameModeInit();
- #endif
- return true;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- SetTimerEx("Timer_DesconectarInventarioTD", 0, false, "i", playerid);
- #if defined td_invent_OnPlayerDisconnect
- td_invent_OnPlayerDisconnect(playerid, reason);
- #endif
- return true;
- }
- forward Timer_DesconectarInventarioTD(playerid);
- public Timer_DesconectarInventarioTD(playerid)
- {
- DestroyInventoryTD(playerid);
- __tempInvAtivo[playerid] = false;
- __tempNoInventario[playerid] = _:INVALID_INVENTORY_ID;
- __tempItemSelecionado[playerid] = -1;
- __tempPaginaInicial[playerid] = -1;
- __tempPaginaSelecionada[playerid] = 0;
- __tempTextdrawSelecionada[playerid] = INVALID_TEXT_DRAW;
- return true;
- }
- public OnPlayerClickTextDraw(playerid, Text:clickedid)
- {
- if(clickedid == Text:INVALID_TEXT_DRAW && __tempInvAtivo[playerid])
- {
- HideInventory(playerid);
- }
- if(__tempNoInventario[playerid] != _:INVALID_INVENTORY_ID)
- {
- new idx = __tempNoInventario[playerid];
- if(IsValidInventory(Inventory:idx))
- {
- if(clickedid == __globalInvTD[6]) // Soltar
- {
- new bool:validItem = false;
- if(__tempItemSelecionado[playerid] > -1)
- {
- new pag = __tempPaginaInicial[playerid];
- new item = __tempItemSelecionado[playerid];
- if(InventoryData[_:idx][pag + item][ObjectModel] != INVALID_INVENTORY_ITEM)
- {
- validItem = true;
- CallLocalFunction("OnPlayerDropItem", "iiiii", playerid, idx, InventoryData[idx][pag + item][ObjectModel], InventoryData[idx][pag + item][TypeIndex], pag + item);
- }
- }
- if(!validItem)
- CallLocalFunction("OnPlayerDropItem", "iiiii", playerid, idx, INVALID_INVENTORY_ITEM, -1, -1);
- }
- else if(clickedid == __globalInvTD[5]) // Usar
- {
- new bool:validItem = false;
- if(__tempItemSelecionado[playerid] > -1)
- {
- new pag = __tempPaginaInicial[playerid];
- new item = __tempItemSelecionado[playerid];
- if(InventoryData[idx][pag + item][ObjectModel] != INVALID_INVENTORY_ITEM)
- {
- validItem = true;
- CallLocalFunction("OnPlayerUseItem", "iiiii", playerid, idx, InventoryData[idx][pag + item][ObjectModel], InventoryData[idx][pag + item][TypeIndex], pag + item);
- new tdid = __tempTextdrawSelecionada[playerid];
- if(tdid != INVALID_TEXT_DRAW)
- {
- new amount[15];
- valstr(amount, InventoryData[idx][pag + item][Amount]);
- PlayerTextDrawSetString(playerid, PlayerText:(tdid + 12), amount);
- PlayerTextDrawShow(playerid, PlayerText:(tdid + 12));
- PlayerTextDrawSetPreviewModel(playerid, PlayerText:tdid, InventoryData[idx][pag + item][ObjectModel]);
- PlayerTextDrawShow(playerid, PlayerText:tdid);
- }
- }
- }
- if(!validItem)
- CallLocalFunction("OnPlayerUseItem", "iiiii", playerid, idx, INVALID_INVENTORY_ITEM, -1, -1);
- }
- else if(clickedid == __globalInvTD[1]) // Fechar
- {
- HideInventory(playerid);
- }
- else if(clickedid == __globalInvTD[2]) // Voltar
- {
- if(__tempPaginaSelecionada[playerid] > 1)
- {
- __tempPaginaSelecionada[playerid] --;
- ShowInventory(Inventory:idx, playerid, __tempPaginaSelecionada[playerid]);
- }
- }
- else if(clickedid == __globalInvTD[3]) // Avançar
- {
- new ultimo_item = GetLastInventoryItemIndex(Inventory:idx);
- new max_paginas = floatround(float(ultimo_item) / 12, floatround_ceil);
- if(__tempPaginaSelecionada[playerid] < max_paginas)
- {
- __tempPaginaSelecionada[playerid] ++;
- ShowInventory(Inventory:idx, playerid, __tempPaginaSelecionada[playerid]);
- }
- }
- }
- }
- #if defined inv_OnPlayerClickTextDraw
- inv_OnPlayerClickTextDraw(playerid, Text:clickedid);
- #endif
- return true;
- }
- public OnPlayerClickDynamicTextdraw(playerid, PlayerText:playertextid)
- {
- if(playertextid == PlayerText:INVALID_TEXT_DRAW && __tempInvAtivo[playerid])
- {
- HideInventory(playerid);
- }
- if(__tempNoInventario[playerid] != _:INVALID_INVENTORY_ID)
- {
- new bool:validItem = false;
- new idx = __tempNoInventario[playerid];
- if(IsValidInventory(Inventory:idx))
- {
- for(new i = 4, j = 0; i <= 15; i ++, j++)
- {
- PlayerTextDrawColor(playerid, __playerInvTD[playerid][i], -1);
- PlayerTextDrawShow(playerid, __playerInvTD[playerid][i]);
- if(playertextid == __playerInvTD[playerid][i])
- {
- new pag = __tempPaginaInicial[playerid];
- __tempItemSelecionado[playerid] = j;
- __tempTextdrawSelecionada[playerid] = _:__playerInvTD[playerid][i];
- PlayerTextDrawColor(playerid, __playerInvTD[playerid][i], 1687547391);
- if(InventoryData[idx][pag + j][ObjectModel] != INVALID_INVENTORY_ITEM)
- {
- validItem = true;
- new titulo[MAX_INVENTORY_TITLE], descricao[MAX_INVENTORY_DESCRIPTION];
- ItemInfo(InventoryData[idx][pag + j][ObjectModel], InventoryData[idx][pag + j][TypeIndex], titulo, descricao);
- ShowInventoryItemInfo(playerid);
- PlayerTextDrawShow(playerid, __playerInvTD[playerid][i]);
- PlayerTextDrawSetPreviewModel(playerid, __playerInvTD[playerid][2], InventoryData[idx][pag + j][ObjectModel]);
- PlayerTextDrawShow(playerid, __playerInvTD[playerid][2]);
- PlayerTextDrawSetString(playerid, __playerInvTD[playerid][1], FixText(titulo));
- PlayerTextDrawShow(playerid, __playerInvTD[playerid][1]);
- PlayerTextDrawSetString(playerid, __playerInvTD[playerid][3], FixText(descricao));
- PlayerTextDrawShow(playerid, __playerInvTD[playerid][3]);
- CallLocalFunction("OnPlayerSelectItem", "iiiii", playerid, idx, InventoryData[idx][pag + j][ObjectModel], InventoryData[idx][pag + j][TypeIndex], pag + j);
- }
- }
- }
- }
- if(!validItem)
- {
- HideInventoryItemInfo(playerid);
- CallLocalFunction("OnPlayerSelectItem", "iiiii", playerid, idx, INVALID_INVENTORY_ITEM, -1, -1);
- }
- }
- #if defined invOnPlayerClickDynamicTextdraw
- invOnPlayerClickDynamicTextdraw(playerid, PlayerText:playertextid);
- #endif
- return true;
- }
- public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
- {
- if((newkeys & OPEN_INVENTORY_KEY == OPEN_INVENTORY_KEY) && (oldkeys & OPEN_INVENTORY_KEY != OPEN_INVENTORY_KEY))
- {
- for(new i = 0; i < MAX_SERVER_INVENTORY; i ++)
- {
- if(!IsValidInventory(Inventory:i))
- continue;
- if(IsPlayerInRangeOfPoint(playerid, 1.0, Inv[i][PosX], Inv[i][PosY], Inv[i][PosZ]))
- {
- if(Inv[i][Interior] != -1 && GetPlayerInterior(playerid) != Inv[i][Interior])
- return true;
- if(Inv[i][VirtualWorld] != -1 && GetPlayerVirtualWorld(playerid) != Inv[i][VirtualWorld])
- return true;
- ShowInventory(Inventory:i, playerid);
- return true;
- }
- }
- }
- if((newkeys & GET_INVENTORY_ITEM_KEY == GET_INVENTORY_ITEM_KEY) && (oldkeys & GET_INVENTORY_ITEM_KEY != GET_INVENTORY_ITEM_KEY))
- {
- for(new i = 0; i < MAX_SERVER_DROPPED_ITEMS; i ++)
- {
- if(__tempServerObjectItem[i] == INVALID_OBJECT_ID)
- continue;
- if(IsPlayerInRangeOfPoint(playerid, 1.5, DroppedServerItemDataPos[i][0], DroppedServerItemDataPos[i][1], DroppedServerItemDataPos[i][2]))
- {
- CallLocalFunction("OnPlayerGetDropedItem", "iiiii", playerid, i, DroppedServerItemData[i][ObjectModel], DroppedServerItemData[i][TypeIndex], DroppedServerItemData[i][Amount]);
- return true;
- }
- }
- }
- #if defined invent_OnPlayerKeyStateChange
- invent_OnPlayerKeyStateChange(playerid, newkeys, oldkeys);
- #endif
- return true;
- }
- stock Inventory:CreateStaticInventory(Float:x, Float:y, Float:z, max_items = MAX_INVENTORY_ITEMS, vw = -1, interior = -1, modelid = -1, Float:rx = 0.0, Float:ry = 0.0, Float:rz = 0.0, const label_text[] = "", destroy_delay = 0, Inventory:id = INVALID_INVENTORY_ID)
- {
- new Inventory:idx = Inventory:GetAvaliableInventoryIndex();
- if(idx == INVALID_INVENTORY_ID)
- return INVALID_INVENTORY_ID;
- Inv[_:idx][ID] = 1;
- Inv[_:idx][Static] = true;
- Inv[_:idx][ObjectModel] = modelid;
- Inv[_:idx][MaxItems] = max_items;
- Inv[_:idx][PosX] = x;
- Inv[_:idx][PosY] = y;
- Inv[_:idx][PosZ] = z;
- Inv[_:idx][VirtualWorld] = vw;
- Inv[_:idx][Interior] = interior;
- if(destroy_delay > 0)
- Inv[_:idx][TimerDestroy] = SetTimerEx("Timer_DestroyInventory", destroy_delay, false, "ib", _:idx, true);
- ClearInventory(idx);
- if(modelid != -1)
- Inv[_:idx][ObjectID] = CreateDynamicObject(modelid, x, y, z, rx, ry, rz, vw, interior);
- if(label_text[0] != '\0')
- Inv[_:idx][Label] = CreateDynamic3DTextLabel(label_text, -1, x, y, z, INVENTORY_LABEL_STREAM, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, vw, interior);
- if(id != INVALID_INVENTORY_ID)
- {
- for(new i = 0; i < MAX_INVENTORY_ITEMS; i ++)
- {
- InventoryData[_:idx][_:i][ObjectModel] = InventoryData[_:id][i][ObjectModel];
- InventoryData[_:idx][_:i][TypeIndex] = InventoryData[_:id][i][TypeIndex];
- InventoryData[_:idx][_:i][Amount] = InventoryData[_:id][i][Amount];
- InventoryData[_:idx][_:i][ItemTitle] = InventoryData[_:id][i][ItemTitle];
- InventoryData[_:idx][_:i][ItemDescription] = InventoryData[_:id][i][ItemDescription];
- }
- }
- CallLocalFunction("OnCreateStaticInventory", "ifffiiii", _:idx, x, y, z, vw, interior, destroy_delay, _:id);
- return Inventory:idx;
- }
- stock Inventory:CreateInventory(Inventory:id = INVALID_INVENTORY_ID, max_items = MAX_INVENTORY_ITEMS)
- {
- new Inventory:idx = Inventory:GetAvaliableInventoryIndex();
- if(idx == INVALID_INVENTORY_ID)
- return INVALID_INVENTORY_ID;
- Inv[_:idx][ID] = 1;
- Inv[_:idx][MaxItems] = max_items;
- ClearInventory(idx);
- if(id != INVALID_INVENTORY_ID)
- {
- for(new i = 0; i < MAX_INVENTORY_ITEMS; i ++)
- {
- InventoryData[_:idx][_:i][ObjectModel] = InventoryData[_:id][i][ObjectModel];
- InventoryData[_:idx][_:i][TypeIndex] = InventoryData[_:id][i][TypeIndex];
- InventoryData[_:idx][_:i][Amount] = InventoryData[_:id][i][Amount];
- InventoryData[_:idx][_:i][ItemTitle] = InventoryData[_:id][i][ItemTitle];
- InventoryData[_:idx][_:i][ItemDescription] = InventoryData[_:id][i][ItemDescription];
- }
- }
- CallLocalFunction("OnCreateInventory", "ii", _:idx, _:id);
- return Inventory:idx;
- }
- forward Inventory:CreatePlayerInventory(playerid);
- stock Inventory:CreatePlayerInventory(playerid)
- {
- CreatePlayerInventoryTD(playerid);
- new Inventory:idx = CreateInventory();
- return idx;
- }
- stock Inventory:GetPlayerOpenedInventory(playerid)
- {
- return Inventory:__tempNoInventario[playerid];
- }
- forward Timer_DestroyInventory(Inventory:id);
- public Timer_DestroyInventory(Inventory:id)
- {
- DestroyInventory(id);
- return true;
- }
- stock AddNewInventoryItem(item, type_index, const title[], const description[])
- {
- new idx = GetFreeInventoryItemSlot();
- if(idx == INVALID_INVENTORY_ITEM)
- return false;
- __tempInventoryItems[idx][ObjectModel] = item;
- __tempInventoryItems[idx][TypeIndex] = type_index;
- strcat((__tempInventoryItems[idx][ItemTitle][0] = '\0', __tempInventoryItems[idx][ItemTitle]), title, MAX_INVENTORY_TITLE);
- strcat((__tempInventoryItems[idx][ItemDescription][0] = '\0', __tempInventoryItems[idx][ItemDescription]), description, MAX_INVENTORY_DESCRIPTION);
- if(__tempInventoryItems[idx][ObjectModel] == 19820 && __tempInventoryItems[idx][TypeIndex] == 0)
- {
- printf("\n\n%s\n\n", __tempInventoryItems[idx][ItemTitle]);
- }
- return true;
- }
- static stock GetFreeInventoryItemSlot()
- {
- for(new i = 0; i < MAX_INTERNAL_INVENTORY_ITEMS; i ++)
- {
- if(__tempInventoryItems[i][ObjectModel] == INVALID_INVENTORY_ITEM)
- return i;
- }
- return INVALID_INVENTORY_ITEM;
- }
- stock AddItemInventory(Inventory:id, item, type_index, amount, index = -1)
- {
- if(!IsValidInventory(id) || !IsValidInventoryItem(item, type_index))
- return false;
- if(CountInventoryItems(id) >= Inv[_:id][MaxItems])
- return false;
- if(index == -1)
- {
- new bool:itemExiste;
- for(new i = 0; i < MAX_INVENTORY_ITEMS; i ++)
- {
- if(InventoryData[_:id][i][ObjectModel] == item && InventoryData[_:id][i][TypeIndex] == type_index)
- {
- InventoryData[_:id][i][Amount] += amount;
- itemExiste = true;
- break;
- }
- }
- if(!itemExiste)
- {
- for(new i = 0; i < MAX_INVENTORY_ITEMS; i ++)
- {
- if(InventoryData[_:id][i][ObjectModel] == INVALID_INVENTORY_ITEM)
- {
- InventoryData[_:id][i][ObjectModel] = item;
- InventoryData[_:id][i][TypeIndex] = type_index;
- InventoryData[_:id][i][Amount] = amount;
- new titulo[MAX_INVENTORY_TITLE], descricao[MAX_INVENTORY_DESCRIPTION];
- ItemInfo(item, type_index, titulo, descricao);
- InventoryData[_:id][i][ItemTitle][0] = '\0';
- InventoryData[_:id][i][ItemDescription][0] = '\0';
- strcat(InventoryData[_:id][i][ItemTitle], titulo);
- strcat(InventoryData[_:id][i][ItemDescription], descricao);
- break;
- }
- }
- }
- }
- else
- {
- if(index > -1 && index < MAX_INVENTORY_ITEMS)
- {
- InventoryData[_:id][index][ObjectModel] = item;
- InventoryData[_:id][index][TypeIndex] = type_index;
- InventoryData[_:id][index][Amount] = amount;
- new titulo[MAX_INVENTORY_TITLE], descricao[MAX_INVENTORY_DESCRIPTION];
- ItemInfo(item, type_index, titulo, descricao);
- InventoryData[_:id][index][ItemTitle][0] = '\0';
- InventoryData[_:id][index][ItemDescription][0] = '\0';
- strcat(InventoryData[_:id][index][ItemTitle], titulo);
- strcat(InventoryData[_:id][index][ItemDescription], descricao);
- }
- }
- return true;
- }
- stock InfoInventoryItem(Inventory:id, index, &item, &type_index, &amount)
- {
- if(!IsValidInventory(id))
- return false;
- if(index < 0 || index > MAX_INVENTORY_ITEMS)
- return false;
- item = InventoryData[_:id][index][ObjectModel];
- type_index = InventoryData[_:id][index][TypeIndex];
- amount = InventoryData[_:id][index][Amount];
- return true;
- }
- stock Inventory:GetStaticInventoryNearPlayer(playerid, Float:range)
- {
- for(new i = 0; i < MAX_SERVER_INVENTORY; i ++)
- {
- if(!IsValidInventory(Inventory:i) || !Inv[i][Static])
- continue;
- if(IsPlayerInRangeOfPoint(playerid, range, Inv[i][PosX], Inv[i][PosY], Inv[i][PosZ]))
- return Inventory:i;
- }
- return INVALID_INVENTORY_ID;
- }
- stock GetInventoryIndexAmount(Inventory:id, index)
- {
- if(!IsValidInventory(id))
- return 0;
- if(index < 0 || index > MAX_INVENTORY_ITEMS)
- return 0;
- return InventoryData[_:id][index][Amount];
- }
- stock GetInventoryItemAmount(Inventory:id, item, type_index)
- {
- if(!IsValidInventory(id) || !IsValidInventoryItem(item, type_index))
- return 0;
- for(new i = 0; i < MAX_INVENTORY_ITEMS; i ++)
- {
- if(InventoryData[_:id][i][ObjectModel] == item && InventoryData[_:id][i][TypeIndex] == type_index)
- return InventoryData[_:id][i][Amount];
- }
- return 0;
- }
- stock ItemInfo(item, type_index, title[], description[])
- {
- if(!IsValidInventoryItem(item, type_index))
- return false;
- for(new i = 0; i < sizeof __tempInventoryItems; i ++)
- {
- if(__tempInventoryItems[i][ObjectModel] == item && __tempInventoryItems[i][TypeIndex] == type_index)
- {
- strcat(title, __tempInventoryItems[i][ItemTitle], MAX_INVENTORY_TITLE);
- strcat(description, __tempInventoryItems[i][ItemDescription], MAX_INVENTORY_DESCRIPTION);
- return true;
- }
- }
- return false;
- }
- stock RemoveInventoryItem(Inventory:id, item, type_index, amount = -1)
- {
- if(!IsValidInventory(id) || !IsValidInventoryItem(item, type_index))
- return false;
- for(new i = 0; i < MAX_INVENTORY_ITEMS; i ++)
- {
- if(InventoryData[_:id][i][ObjectModel] == item)
- {
- InventoryData[_:id][i][Amount] = amount > -1 ? (InventoryData[_:id][i][Amount] - amount) : 0;
- if(InventoryData[_:id][i][Amount] <= 0)
- {
- InventoryData[_:id][i][ObjectModel] = INVALID_INVENTORY_ITEM;
- InventoryData[_:id][i][Amount] = 0;
- InventoryData[_:id][i][ItemTitle][0] = '\0';
- InventoryData[_:id][i][ItemDescription][0] = '\0';
- }
- break;
- }
- }
- CallLocalFunction("OnRemoveInventoryItem", "iiii", _:id, item, type_index, amount);
- return true;
- }
- stock RemoveInventoryItemIndex(Inventory:id, index)
- {
- if(!IsValidInventory(id))
- return false;
- InventoryData[_:id][index][ObjectModel] = INVALID_INVENTORY_ITEM;
- InventoryData[_:id][index][Amount] = 0;
- InventoryData[_:id][index][ItemTitle][0] = '\0';
- InventoryData[_:id][index][ItemDescription][0] = '\0';
- return true;
- }
- stock HaveInventoryItem(Inventory:id, item, type_index)
- {
- if(!IsValidInventory(id) || !IsValidInventoryItem(item, type_index))
- return false;
- for(new i = 0; i < MAX_INVENTORY_ITEMS; i ++)
- {
- if(InventoryData[_:id][i][ObjectModel] == item && InventoryData[_:id][i][TypeIndex] == type_index)
- return true;
- }
- return false;
- }
- stock ClearInventory(Inventory:id)
- {
- if(!IsValidInventory(id))
- return false;
- for(new i = 0; i < MAX_INVENTORY_ITEMS; i ++)
- {
- InventoryData[_:id][i][ObjectModel] = INVALID_INVENTORY_ITEM;
- InventoryData[_:id][i][Amount] = 0;
- InventoryData[_:id][i][ItemTitle][0] = '\0';
- InventoryData[_:id][i][ItemDescription][0] = '\0';
- }
- return true;
- }
- stock IsValidInventory(Inventory:id)
- {
- if(_:id < 0 || _:id > MAX_SERVER_INVENTORY)
- return false;
- return (Inv[_:id][ID] == 1);
- }
- stock IsStaticInventory(Inventory:id)
- {
- if(!IsValidInventory(id))
- return false;
- return Inv[_:id][Static];
- }
- stock IsTemporaryInventory(Inventory:id)
- {
- if(!IsValidInventory(id))
- return false;
- return Inv[_:id][TimerDestroy] > 0;
- }
- stock CountInventoryItems(Inventory:id)
- {
- if(!IsValidInventory(id))
- return -1;
- new itens = 0;
- for(new i = 0; i < MAX_INVENTORY_ITEMS; i ++)
- {
- if(InventoryData[_:id][i][ObjectModel] != INVALID_INVENTORY_ITEM)
- itens ++;
- }
- return itens;
- }
- stock SetInventoryMaxItems(Inventory:id, max_items)
- {
- if(!IsValidInventory(id))
- return false;
- if(max_items < 1)
- max_items = 1;
- else if(max_items > MAX_INVENTORY_ITEMS)
- max_items = MAX_INVENTORY_ITEMS;
- Inv[_:id][MaxItems] = max_items;
- return true;
- }
- stock GetInventoryMaxItems(Inventory:id)
- {
- if(!IsValidInventory(id))
- return 0;
- return Inv[_:id][MaxItems];
- }
- stock GetLastInventoryItemIndex(Inventory:id)
- {
- if(!IsValidInventory(id))
- return -1;
- for(new i = MAX_INVENTORY_ITEMS - 1; i > -1; i --)
- {
- if(InventoryData[_:id][i][ObjectModel] != INVALID_INVENTORY_ITEM)
- return i;
- }
- return -1;
- }
- stock IsValidInventoryItem(item, type_index)
- {
- for(new i = 0; i < sizeof __tempInventoryItems; i ++)
- {
- if(__tempInventoryItems[i][ObjectModel] == item && __tempInventoryItems[i][TypeIndex] == type_index)
- return true;
- }
- return false;
- }
- stock GetInventoryItemIndex(Inventory:id, item, type_index)
- {
- for(new i = 0; i < MAX_INVENTORY_ITEMS; i ++)
- {
- if(InventoryData[_:id][i][ObjectModel] == item && InventoryData[_:id][i][TypeIndex] == type_index)
- return i;
- }
- return -1;
- }
- static stock GetFreeDroppedItemSlot()
- {
- for(new i = 0; i < MAX_SERVER_DROPPED_ITEMS; i ++)
- {
- if(__tempServerObjectItem[i] == INVALID_OBJECT_ID)
- return i;
- }
- return -1;
- }
- stock CreateDropItem(item, type_index, amount, Float:x, Float:y, Float:z, Float:rx = 0.0, Float:ry = 0.0, Float:rz = 0.0, vw = -1, interior = -1)
- {
- new idxDrop = GetFreeDroppedItemSlot();
- if(!IsValidInventoryItem(item, type_index) || idxDrop == -1)
- return false;
- new title[MAX_INVENTORY_TITLE], description[MAX_INVENTORY_DESCRIPTION];
- ItemInfo(item, type_index, title, description);
- __tempServerObjectItem[idxDrop] = CreateDynamicObject(item, x, y, z, rx, ry, rz, vw, interior);
- new label[50];
- format(label, sizeof label, "%s\nPressione Y", title);
- __tempServerObjectLabel[idxDrop] = CreateDynamic3DTextLabel(label, -1, x, y, z, INVENTORY_LABEL_STREAM, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, vw, interior);
- DroppedServerItemData[idxDrop][ObjectModel] = item;
- DroppedServerItemData[idxDrop][TypeIndex] = type_index;
- DroppedServerItemData[idxDrop][Amount] = amount;
- strcat((DroppedServerItemData[idxDrop][ItemTitle][0] = '\0', DroppedServerItemData[idxDrop][ItemTitle]), title, MAX_INVENTORY_TITLE);
- strcat((DroppedServerItemData[idxDrop][ItemDescription][0] = '\0', DroppedServerItemData[idxDrop][ItemDescription]), description, MAX_INVENTORY_DESCRIPTION);
- DroppedServerItemDataPos[idxDrop][0] = x;
- DroppedServerItemDataPos[idxDrop][1] = y;
- DroppedServerItemDataPos[idxDrop][2] = z;
- return true;
- }
- stock RemoveDroppedItem(dropped_index)
- {
- DestroyDynamicObject(__tempServerObjectItem[dropped_index]);
- __tempServerObjectItem[dropped_index] = INVALID_OBJECT_ID;
- DestroyDynamic3DTextLabel(__tempServerObjectLabel[dropped_index]);
- __tempServerObjectLabel[dropped_index] = Text3D:0;
- DroppedServerItemData[dropped_index][ObjectModel] = INVALID_INVENTORY_ITEM;
- DroppedServerItemData[dropped_index][TypeIndex] = 0;
- DroppedServerItemData[dropped_index][Amount] = 0;
- DroppedServerItemData[dropped_index][ItemTitle][0] = '\0';
- DroppedServerItemData[dropped_index][ItemDescription][0] = '\0';
- DroppedServerItemDataPos[dropped_index][0] = 0.0;
- DroppedServerItemDataPos[dropped_index][1] = 0.0;
- DroppedServerItemDataPos[dropped_index][2] = 0.0;
- return true;
- }
- stock CountDroppedItem(item, type_index = 0)
- {
- new count;
- for(new i = 0; i < MAX_SERVER_DROPPED_ITEMS; i ++)
- {
- if(DroppedServerItemData[i][ObjectModel] == INVALID_INVENTORY_ITEM)
- continue;
- if(DroppedServerItemData[i][ObjectModel] == item && DroppedServerItemData[i][TypeIndex] == type_index)
- count++;
- }
- return count;
- }
- stock CountDroppedItems()
- {
- new count;
- for(new i = 0; i < MAX_SERVER_DROPPED_ITEMS; i ++)
- {
- if(DroppedServerItemData[i][ObjectModel] != INVALID_INVENTORY_ITEM)
- count ++;
- }
- return count;
- }
- stock ShowInventory(Inventory:id, playerid, page = 1, bool:button_use = true, bool:button_drop = true)
- {
- if(!IsValidInventory(id) || page < 1)
- return false;
- __tempInvAtivo[playerid] = true;
- new ultimo_item = GetLastInventoryItemIndex(id);
- new max_paginas = floatround(float(ultimo_item) / 12, floatround_ceil);
- new a_fim_pagina = page == 1 ? 12 : page * 12 - 1;
- new a_inicio_pagina = page == 1 ? 0 : a_fim_pagina - 12 + 1;
- if(__tempNoInventario[playerid] == _:INVALID_INVENTORY_ID)
- CallLocalFunction("OnPlayerOpenInventory", "ii", playerid, _:id);
- __tempNoInventario[playerid] = _:id;
- __tempBotaoUsar[playerid] = button_use;
- __tempBotaoSoltar[playerid] = button_drop;
- __tempPaginaSelecionada[playerid] = page;
- __tempPaginaInicial[playerid] = a_inicio_pagina;
- new stringInv[20];
- format(stringInv, sizeof stringInv, "Inventario (%i/%i)", page, max_paginas < 1 ? 1 : max_paginas);
- PlayerTextDrawSetString(playerid, __playerInvTD[playerid][0], stringInv);
- PlayerTextDrawSetPreviewModel(playerid, __playerInvTD[playerid][2], INVALID_INVENTORY_ITEM);
- PlayerTextDrawSetString(playerid, __playerInvTD[playerid][1], "_");
- PlayerTextDrawShow(playerid, __playerInvTD[playerid][1]);
- PlayerTextDrawSetString(playerid, __playerInvTD[playerid][3], "_");
- PlayerTextDrawShow(playerid, __playerInvTD[playerid][3]);
- for(new i = 0; i <= 3; i ++)
- TextDrawShowForPlayer(playerid, __globalInvTD[i]);
- for(new i = 4, j = 0; i <= 15; i ++, j++) // Itens
- {
- PlayerTextDrawSetPreviewModel(playerid, __playerInvTD[playerid][i], InventoryData[_:id][a_inicio_pagina + j][ObjectModel]);
- }
- for(new i = 16, j = 0; i <= 27; i ++, j++) // Valores do itens
- {
- format(stringInv, sizeof stringInv, "%i", InventoryData[_:id][a_inicio_pagina + j][Amount]);
- PlayerTextDrawSetString(playerid, __playerInvTD[playerid][i], stringInv);
- }
- for(new i = 4; i <= 15; i ++)
- PlayerTextDrawShow(playerid, __playerInvTD[playerid][i]);
- for(new i = 4; i <= 15; i ++)
- PlayerTextDrawColor(playerid, __playerInvTD[playerid][i], -1);
- for(new i = 16, j = 0; i <= 27; i ++, j ++)
- {
- if(InventoryData[_:id][a_inicio_pagina + j][ObjectModel] != INVALID_INVENTORY_ITEM)
- PlayerTextDrawShow(playerid, __playerInvTD[playerid][i]);
- }
- HideInventoryItemInfo(playerid);
- SelectTextDraw(playerid, 1687547391);
- return true;
- }
- stock ShowInventoryItemInfo(playerid)
- {
- TextDrawShowForPlayer(playerid, __globalInvTD[4]);
- if(__tempBotaoUsar[playerid])
- TextDrawShowForPlayer(playerid, __globalInvTD[5]);
- if(__tempBotaoSoltar[playerid])
- TextDrawShowForPlayer(playerid, __globalInvTD[6]);
- for(new i = 1; i <= 3; i ++)
- PlayerTextDrawShow(playerid, __playerInvTD[playerid][i]);
- }
- stock HideInventoryItemInfo(playerid)
- {
- for(new i = 4; i <= 6; i ++)
- TextDrawHideForPlayer(playerid, __globalInvTD[i]);
- for(new i = 1; i <= 3; i ++)
- PlayerTextDrawHide(playerid, __playerInvTD[playerid][i]);
- }
- stock HideInventory(playerid)
- {
- __tempInvAtivo[playerid] = false;
- for(new i = 0; i <= 6; i ++)
- TextDrawHideForPlayer(playerid, __globalInvTD[i]);
- for(new i = 0; i <= 27; i ++)
- PlayerTextDrawHide(playerid, __playerInvTD[playerid][i]);
- if(__tempNoInventario[playerid] != _:INVALID_INVENTORY_ID)
- CallLocalFunction("OnPlayerCloseInventory", "ii", playerid, __tempNoInventario[playerid]);
- CancelSelectTextDraw(playerid);
- __tempNoInventario[playerid] = _:INVALID_INVENTORY_ID;
- __tempItemSelecionado[playerid] = -1;
- __tempPaginaInicial[playerid] = 0;
- __tempPaginaSelecionada[playerid] = 0;
- __tempTextdrawSelecionada[playerid] = INVALID_TEXT_DRAW;
- return true;
- }
- stock DestroyInventory(Inventory:id)
- {
- if(!IsValidInventory(id))
- return false;
- foreach(new i : Player)
- {
- if(__tempNoInventario[i] == _:id)
- {
- __tempNoInventario[i] = _:INVALID_INVENTORY_ID;
- HideInventory(i);
- CallLocalFunction("OnDestroyOpenedInventory", "ii", i, _:id);
- }
- }
- CallLocalFunction("OnDestroyInventory", "ii", _:id, Inv[_:id][Static]);
- KillTimer(Inv[_:id][TimerDestroy]);
- DestroyDynamicObject(Inv[_:id][ObjectID]);
- DestroyDynamic3DTextLabel(Inv[_:id][Label]);
- ClearInventory(id);
- new reset[E_INVENTARIO_SERVER_DATA];
- Inv[_:id] = reset;
- return true;
- }
- static stock GetAvaliableInventoryIndex()
- {
- for(new i = 0; i < MAX_SERVER_INVENTORY; i ++)
- {
- if(Inv[i][ID] == 0)
- return i;
- }
- return -1;
- }
- static stock DestroyInventoryTD(playerid)
- {
- for(new ii = 0; ii <= 27; ii ++)
- {
- PlayerTextDrawDestroy(playerid, __playerInvTD[playerid][ii]);
- __playerInvTD[playerid][ii] = PlayerText:INVALID_TEXT_DRAW;
- }
- return true;
- }
- static stock CreateInventoryTD()
- {
- __globalInvTD[0] = TextDrawCreate(151.000, 174.000, "_");
- TextDrawLetterSize(__globalInvTD[0], 0.000, 26.100);
- TextDrawTextSize(__globalInvTD[0], 441.000, 0.000);
- TextDrawAlignment(__globalInvTD[0], 1);
- TextDrawColor(__globalInvTD[0], 255);
- TextDrawUseBox(__globalInvTD[0], 1);
- TextDrawBoxColor(__globalInvTD[0], 1684300950);
- TextDrawSetShadow(__globalInvTD[0], 1);
- TextDrawSetOutline(__globalInvTD[0], 1);
- TextDrawBackgroundColor(__globalInvTD[0], 255);
- TextDrawFont(__globalInvTD[0], 0);
- TextDrawSetProportional(__globalInvTD[0], 1);
- __globalInvTD[1] = TextDrawCreate(426.000, 174.000, "X");
- TextDrawLetterSize(__globalInvTD[1], 0.689, 1.798);
- TextDrawTextSize(__globalInvTD[1], 13.000, 19.000);
- TextDrawAlignment(__globalInvTD[1], 2);
- TextDrawColor(__globalInvTD[1], -1);
- TextDrawSetShadow(__globalInvTD[1], 0);
- TextDrawSetOutline(__globalInvTD[1], 1);
- TextDrawBackgroundColor(__globalInvTD[1], -16776961);
- TextDrawFont(__globalInvTD[1], 1);
- TextDrawSetProportional(__globalInvTD[1], 1);
- TextDrawSetSelectable(__globalInvTD[1], 1);
- __globalInvTD[2] = TextDrawCreate(318.000, 173.000, "LD_BEAT:left");
- TextDrawTextSize(__globalInvTD[2], 21.000, 20.000);
- TextDrawAlignment(__globalInvTD[2], 1);
- TextDrawColor(__globalInvTD[2], -1);
- TextDrawSetShadow(__globalInvTD[2], 0);
- TextDrawSetOutline(__globalInvTD[2], 0);
- TextDrawBackgroundColor(__globalInvTD[2], 255);
- TextDrawFont(__globalInvTD[2], 4);
- TextDrawSetProportional(__globalInvTD[2], 1);
- TextDrawSetSelectable(__globalInvTD[2], 1);
- __globalInvTD[3] = TextDrawCreate(366.000, 173.000, "LD_BEAT:right");
- TextDrawTextSize(__globalInvTD[3], 21.000, 20.000);
- TextDrawAlignment(__globalInvTD[3], 1);
- TextDrawColor(__globalInvTD[3], -1);
- TextDrawSetShadow(__globalInvTD[3], 0);
- TextDrawSetOutline(__globalInvTD[3], 0);
- TextDrawBackgroundColor(__globalInvTD[3], 255);
- TextDrawFont(__globalInvTD[3], 4);
- TextDrawSetProportional(__globalInvTD[3], 1);
- TextDrawSetSelectable(__globalInvTD[3], 1);
- __globalInvTD[4] = TextDrawCreate(444.000, 174.000, "_");
- TextDrawLetterSize(__globalInvTD[4], 0.000, 26.100);
- TextDrawTextSize(__globalInvTD[4], 574.000, 0.000);
- TextDrawAlignment(__globalInvTD[4], 1);
- TextDrawColor(__globalInvTD[4], 255);
- TextDrawUseBox(__globalInvTD[4], 1);
- TextDrawBoxColor(__globalInvTD[4], 1684300950);
- TextDrawSetShadow(__globalInvTD[4], 1);
- TextDrawSetOutline(__globalInvTD[4], 1);
- TextDrawBackgroundColor(__globalInvTD[4], 255);
- TextDrawFont(__globalInvTD[4], 0);
- TextDrawSetProportional(__globalInvTD[4], 1);
- __globalInvTD[5] = TextDrawCreate(477.000, 390.000, "Usar");
- TextDrawLetterSize(__globalInvTD[5], 0.319, 1.600);
- TextDrawTextSize(__globalInvTD[5], 14.000, 58.000);
- TextDrawAlignment(__globalInvTD[5], 2);
- TextDrawColor(__globalInvTD[5], -1199174657);
- TextDrawUseBox(__globalInvTD[5], 1);
- TextDrawBoxColor(__globalInvTD[5], 150);
- TextDrawSetShadow(__globalInvTD[5], 1);
- TextDrawSetOutline(__globalInvTD[5], 1);
- TextDrawBackgroundColor(__globalInvTD[5], 150);
- TextDrawFont(__globalInvTD[5], 2);
- TextDrawSetProportional(__globalInvTD[5], 1);
- TextDrawSetSelectable(__globalInvTD[5], 1);
- __globalInvTD[6] = TextDrawCreate(541.000, 390.000, "Soltar");
- TextDrawLetterSize(__globalInvTD[6], 0.319, 1.600);
- TextDrawTextSize(__globalInvTD[6], 14.000, 58.000);
- TextDrawAlignment(__globalInvTD[6], 2);
- TextDrawColor(__globalInvTD[6], 2005441023);
- TextDrawUseBox(__globalInvTD[6], 1);
- TextDrawBoxColor(__globalInvTD[6], 150);
- TextDrawSetShadow(__globalInvTD[6], 1);
- TextDrawSetOutline(__globalInvTD[6], 1);
- TextDrawBackgroundColor(__globalInvTD[6], 150);
- TextDrawFont(__globalInvTD[6], 2);
- TextDrawSetProportional(__globalInvTD[6], 1);
- TextDrawSetSelectable(__globalInvTD[6], 1);
- }
- static stock CreatePlayerInventoryTD(playerid)
- {
- if(!IsPlayerConnected(playerid))
- return false;
- new tituloInv[20 + MAX_PLAYER_NAME];
- format(tituloInv, sizeof tituloInv, "Inventario de: %s", NomeJogador(playerid));
- //InvTD[MAX_PLAYERS][5]
- __playerInvTD[playerid][0] = CreatePlayerTextDraw(playerid, 156.000, 175.000, "Inventario (1/1)");
- PlayerTextDrawLetterSize(playerid, __playerInvTD[playerid][0], 0.509, 1.599);
- PlayerTextDrawAlignment(playerid, __playerInvTD[playerid][0], 1);
- PlayerTextDrawColor(playerid, __playerInvTD[playerid][0], -1);
- PlayerTextDrawSetShadow(playerid, __playerInvTD[playerid][0], 1);
- PlayerTextDrawSetOutline(playerid, __playerInvTD[playerid][0], 1);
- PlayerTextDrawBackgroundColor(playerid, __playerInvTD[playerid][0], 150);
- PlayerTextDrawFont(playerid, __playerInvTD[playerid][0], 3);
- PlayerTextDrawSetProportional(playerid, __playerInvTD[playerid][0], 1);
- __playerInvTD[playerid][1] = CreatePlayerTextDraw(playerid, 510.000, 177.000, "Nome_Do_Item");
- PlayerTextDrawLetterSize(playerid, __playerInvTD[playerid][1], 0.230, 1.399);
- PlayerTextDrawAlignment(playerid, __playerInvTD[playerid][1], 2);
- PlayerTextDrawColor(playerid, __playerInvTD[playerid][1], -1);
- PlayerTextDrawSetShadow(playerid, __playerInvTD[playerid][1], 1);
- PlayerTextDrawSetOutline(playerid, __playerInvTD[playerid][1], 1);
- PlayerTextDrawBackgroundColor(playerid, __playerInvTD[playerid][1], 150);
- PlayerTextDrawFont(playerid, __playerInvTD[playerid][1], 2);
- PlayerTextDrawSetProportional(playerid, __playerInvTD[playerid][1], 1);
- __playerInvTD[playerid][2] = CreatePlayerTextDraw(playerid, 454.000, 191.000, "_");
- PlayerTextDrawTextSize(playerid, __playerInvTD[playerid][2], 109.000, 113.000);
- PlayerTextDrawAlignment(playerid, __playerInvTD[playerid][2], 1);
- PlayerTextDrawColor(playerid, __playerInvTD[playerid][2], -1);
- PlayerTextDrawSetShadow(playerid, __playerInvTD[playerid][2], 0);
- PlayerTextDrawSetOutline(playerid, __playerInvTD[playerid][2], 0);
- PlayerTextDrawBackgroundColor(playerid, __playerInvTD[playerid][2], 0);
- PlayerTextDrawFont(playerid, __playerInvTD[playerid][2], 5);
- PlayerTextDrawSetProportional(playerid, __playerInvTD[playerid][2], 0);
- PlayerTextDrawSetPreviewModel(playerid, __playerInvTD[playerid][2], -1);
- PlayerTextDrawSetPreviewRot(playerid, __playerInvTD[playerid][2], 0.000, 0.000, 0.000, 1.000);
- PlayerTextDrawSetPreviewVehCol(playerid, __playerInvTD[playerid][2], 0, 0);
- __playerInvTD[playerid][3] = CreatePlayerTextDraw(playerid, 451.000, 302.000, "Descricao do item~n~clicado");
- PlayerTextDrawLetterSize(playerid, __playerInvTD[playerid][3], 0.300, 1.500);
- PlayerTextDrawAlignment(playerid, __playerInvTD[playerid][3], 1);
- PlayerTextDrawColor(playerid, __playerInvTD[playerid][3], -1);
- PlayerTextDrawSetShadow(playerid, __playerInvTD[playerid][3], 1);
- PlayerTextDrawSetOutline(playerid, __playerInvTD[playerid][3], 1);
- PlayerTextDrawBackgroundColor(playerid, __playerInvTD[playerid][3], 150);
- PlayerTextDrawFont(playerid, __playerInvTD[playerid][3], 1);
- PlayerTextDrawSetProportional(playerid, __playerInvTD[playerid][3], 1);
- __playerInvTD[playerid][4] = CreatePlayerTextDraw(playerid, 153.000, 193.000, "_");
- PlayerTextDrawTextSize(playerid, __playerInvTD[playerid][4], 70.000, 70.000);
- PlayerTextDrawAlignment(playerid, __playerInvTD[playerid][4], 1);
- PlayerTextDrawColor(playerid, __playerInvTD[playerid][4], -1);
- PlayerTextDrawSetShadow(playerid, __playerInvTD[playerid][4], 0);
- PlayerTextDrawSetOutline(playerid, __playerInvTD[playerid][4], 0);
- PlayerTextDrawBackgroundColor(playerid, __playerInvTD[playerid][4], 1887473789);
- PlayerTextDrawFont(playerid, __playerInvTD[playerid][4], 5);
- PlayerTextDrawSetProportional(playerid, __playerInvTD[playerid][4], 0);
- PlayerTextDrawSetPreviewModel(playerid, __playerInvTD[playerid][4], -1);
- PlayerTextDrawSetPreviewRot(playerid, __playerInvTD[playerid][4], 0.000, 0.000, 0.000, 1.000);
- PlayerTextDrawSetPreviewVehCol(playerid, __playerInvTD[playerid][4], 0, 0);
- PlayerTextDrawSetSelectable(playerid, __playerInvTD[playerid][4], 1);
- __playerInvTD[playerid][5] = CreatePlayerTextDraw(playerid, 225.000, 193.000, "_");
- PlayerTextDrawTextSize(playerid, __playerInvTD[playerid][5], 70.000, 70.000);
- PlayerTextDrawAlignment(playerid, __playerInvTD[playerid][5], 1);
- PlayerTextDrawColor(playerid, __playerInvTD[playerid][5], -1);
- PlayerTextDrawSetShadow(playerid, __playerInvTD[playerid][5], 0);
- PlayerTextDrawSetOutline(playerid, __playerInvTD[playerid][5], 0);
- PlayerTextDrawBackgroundColor(playerid, __playerInvTD[playerid][5], 1887473789);
- PlayerTextDrawFont(playerid, __playerInvTD[playerid][5], 5);
- PlayerTextDrawSetProportional(playerid, __playerInvTD[playerid][5], 0);
- PlayerTextDrawSetPreviewModel(playerid, __playerInvTD[playerid][5], -1);
- PlayerTextDrawSetPreviewRot(playerid, __playerInvTD[playerid][5], 0.000, 0.000, 0.000, 1.000);
- PlayerTextDrawSetPreviewVehCol(playerid, __playerInvTD[playerid][5], 0, 0);
- PlayerTextDrawSetSelectable(playerid, __playerInvTD[playerid][5], 1);
- __playerInvTD[playerid][6] = CreatePlayerTextDraw(playerid, 297.000, 193.000, "_");
- PlayerTextDrawTextSize(playerid, __playerInvTD[playerid][6], 70.000, 70.000);
- PlayerTextDrawAlignment(playerid, __playerInvTD[playerid][6], 1);
- PlayerTextDrawColor(playerid, __playerInvTD[playerid][6], -1);
- PlayerTextDrawSetShadow(playerid, __playerInvTD[playerid][6], 0);
- PlayerTextDrawSetOutline(playerid, __playerInvTD[playerid][6], 0);
- PlayerTextDrawBackgroundColor(playerid, __playerInvTD[playerid][6], 1887473789);
- PlayerTextDrawFont(playerid, __playerInvTD[playerid][6], 5);
- PlayerTextDrawSetProportional(playerid, __playerInvTD[playerid][6], 0);
- PlayerTextDrawSetPreviewModel(playerid, __playerInvTD[playerid][6], -1);
- PlayerTextDrawSetPreviewRot(playerid, __playerInvTD[playerid][6], 0.000, 0.000, 0.000, 1.000);
- PlayerTextDrawSetPreviewVehCol(playerid, __playerInvTD[playerid][6], 0, 0);
- PlayerTextDrawSetSelectable(playerid, __playerInvTD[playerid][6], 1);
- __playerInvTD[playerid][7] = CreatePlayerTextDraw(playerid, 369.000, 193.000, "_");
- PlayerTextDrawTextSize(playerid, __playerInvTD[playerid][7], 70.000, 70.000);
- PlayerTextDrawAlignment(playerid, __playerInvTD[playerid][7], 1);
- PlayerTextDrawColor(playerid, __playerInvTD[playerid][7], -1);
- PlayerTextDrawSetShadow(playerid, __playerInvTD[playerid][7], 0);
- PlayerTextDrawSetOutline(playerid, __playerInvTD[playerid][7], 0);
- PlayerTextDrawBackgroundColor(playerid, __playerInvTD[playerid][7], 1887473789);
- PlayerTextDrawFont(playerid, __playerInvTD[playerid][7], 5);
- PlayerTextDrawSetProportional(playerid, __playerInvTD[playerid][7], 0);
- PlayerTextDrawSetPreviewModel(playerid, __playerInvTD[playerid][7], -1);
- PlayerTextDrawSetPreviewRot(playerid, __playerInvTD[playerid][7], 0.000, 0.000, 0.000, 1.000);
- PlayerTextDrawSetPreviewVehCol(playerid, __playerInvTD[playerid][7], 0, 0);
- PlayerTextDrawSetSelectable(playerid, __playerInvTD[playerid][7], 1);
- __playerInvTD[playerid][8] = CreatePlayerTextDraw(playerid, 153.000, 265.000, "_");
- PlayerTextDrawTextSize(playerid, __playerInvTD[playerid][8], 70.000, 70.000);
- PlayerTextDrawAlignment(playerid, __playerInvTD[playerid][8], 1);
- PlayerTextDrawColor(playerid, __playerInvTD[playerid][8], -1);
- PlayerTextDrawSetShadow(playerid, __playerInvTD[playerid][8], 0);
- PlayerTextDrawSetOutline(playerid, __playerInvTD[playerid][8], 0);
- PlayerTextDrawBackgroundColor(playerid, __playerInvTD[playerid][8], 1887473789);
- PlayerTextDrawFont(playerid, __playerInvTD[playerid][8], 5);
- PlayerTextDrawSetProportional(playerid, __playerInvTD[playerid][8], 0);
- PlayerTextDrawSetPreviewModel(playerid, __playerInvTD[playerid][8], -1);
- PlayerTextDrawSetPreviewRot(playerid, __playerInvTD[playerid][8], 0.000, 0.000, 0.000, 1.000);
- PlayerTextDrawSetPreviewVehCol(playerid, __playerInvTD[playerid][8], 0, 0);
- PlayerTextDrawSetSelectable(playerid, __playerInvTD[playerid][8], 1);
- __playerInvTD[playerid][9] = CreatePlayerTextDraw(playerid, 225.000, 265.000, "_");
- PlayerTextDrawTextSize(playerid, __playerInvTD[playerid][9], 70.000, 70.000);
- PlayerTextDrawAlignment(playerid, __playerInvTD[playerid][9], 1);
- PlayerTextDrawColor(playerid, __playerInvTD[playerid][9], -1);
- PlayerTextDrawSetShadow(playerid, __playerInvTD[playerid][9], 0);
- PlayerTextDrawSetOutline(playerid, __playerInvTD[playerid][9], 0);
- PlayerTextDrawBackgroundColor(playerid, __playerInvTD[playerid][9], 1887473789);
- PlayerTextDrawFont(playerid, __playerInvTD[playerid][9], 5);
- PlayerTextDrawSetProportional(playerid, __playerInvTD[playerid][9], 0);
- PlayerTextDrawSetPreviewModel(playerid, __playerInvTD[playerid][9], -1);
- PlayerTextDrawSetPreviewRot(playerid, __playerInvTD[playerid][9], 0.000, 0.000, 0.000, 1.000);
- PlayerTextDrawSetPreviewVehCol(playerid, __playerInvTD[playerid][9], 0, 0);
- PlayerTextDrawSetSelectable(playerid, __playerInvTD[playerid][9], 1);
- __playerInvTD[playerid][10] = CreatePlayerTextDraw(playerid, 297.000, 265.000, "_");
- PlayerTextDrawTextSize(playerid, __playerInvTD[playerid][10], 70.000, 70.000);
- PlayerTextDrawAlignment(playerid, __playerInvTD[playerid][10], 1);
- PlayerTextDrawColor(playerid, __playerInvTD[playerid][10], -1);
- PlayerTextDrawSetShadow(playerid, __playerInvTD[playerid][10], 0);
- PlayerTextDrawSetOutline(playerid, __playerInvTD[playerid][10], 0);
- PlayerTextDrawBackgroundColor(playerid, __playerInvTD[playerid][10], 1887473789);
- PlayerTextDrawFont(playerid, __playerInvTD[playerid][10], 5);
- PlayerTextDrawSetProportional(playerid, __playerInvTD[playerid][10], 0);
- PlayerTextDrawSetPreviewModel(playerid, __playerInvTD[playerid][10], -1);
- PlayerTextDrawSetPreviewRot(playerid, __playerInvTD[playerid][10], 0.000, 0.000, 0.000, 1.000);
- PlayerTextDrawSetPreviewVehCol(playerid, __playerInvTD[playerid][10], 0, 0);
- PlayerTextDrawSetSelectable(playerid, __playerInvTD[playerid][10], 1);
- __playerInvTD[playerid][11] = CreatePlayerTextDraw(playerid, 369.000, 265.000, "_");
- PlayerTextDrawTextSize(playerid, __playerInvTD[playerid][11], 70.000, 70.000);
- PlayerTextDrawAlignment(playerid, __playerInvTD[playerid][11], 1);
- PlayerTextDrawColor(playerid, __playerInvTD[playerid][11], -1);
- PlayerTextDrawSetShadow(playerid, __playerInvTD[playerid][11], 0);
- PlayerTextDrawSetOutline(playerid, __playerInvTD[playerid][11], 0);
- PlayerTextDrawBackgroundColor(playerid, __playerInvTD[playerid][11], 1887473789);
- PlayerTextDrawFont(playerid, __playerInvTD[playerid][11], 5);
- PlayerTextDrawSetProportional(playerid, __playerInvTD[playerid][11], 0);
- PlayerTextDrawSetPreviewModel(playerid, __playerInvTD[playerid][11], -1);
- PlayerTextDrawSetPreviewRot(playerid, __playerInvTD[playerid][11], 0.000, 0.000, 0.000, 1.000);
- PlayerTextDrawSetPreviewVehCol(playerid, __playerInvTD[playerid][11], 0, 0);
- PlayerTextDrawSetSelectable(playerid, __playerInvTD[playerid][11], 1);
- __playerInvTD[playerid][12] = CreatePlayerTextDraw(playerid, 153.000, 337.000, "_");
- PlayerTextDrawTextSize(playerid, __playerInvTD[playerid][12], 70.000, 70.000);
- PlayerTextDrawAlignment(playerid, __playerInvTD[playerid][12], 1);
- PlayerTextDrawColor(playerid, __playerInvTD[playerid][12], -1);
- PlayerTextDrawSetShadow(playerid, __playerInvTD[playerid][12], 0);
- PlayerTextDrawSetOutline(playerid, __playerInvTD[playerid][12], 0);
- PlayerTextDrawBackgroundColor(playerid, __playerInvTD[playerid][12], 1887473789);
- PlayerTextDrawFont(playerid, __playerInvTD[playerid][12], 5);
- PlayerTextDrawSetProportional(playerid, __playerInvTD[playerid][12], 0);
- PlayerTextDrawSetPreviewModel(playerid, __playerInvTD[playerid][12], -1);
- PlayerTextDrawSetPreviewRot(playerid, __playerInvTD[playerid][12], 0.000, 0.000, 0.000, 1.000);
- PlayerTextDrawSetPreviewVehCol(playerid, __playerInvTD[playerid][12], 0, 0);
- PlayerTextDrawSetSelectable(playerid, __playerInvTD[playerid][12], 1);
- __playerInvTD[playerid][13] = CreatePlayerTextDraw(playerid, 225.000, 337.000, "_");
- PlayerTextDrawTextSize(playerid, __playerInvTD[playerid][13], 70.000, 70.000);
- PlayerTextDrawAlignment(playerid, __playerInvTD[playerid][13], 1);
- PlayerTextDrawColor(playerid, __playerInvTD[playerid][13], -1);
- PlayerTextDrawSetShadow(playerid, __playerInvTD[playerid][13], 0);
- PlayerTextDrawSetOutline(playerid, __playerInvTD[playerid][13], 0);
- PlayerTextDrawBackgroundColor(playerid, __playerInvTD[playerid][13], 1887473789);
- PlayerTextDrawFont(playerid, __playerInvTD[playerid][13], 5);
- PlayerTextDrawSetProportional(playerid, __playerInvTD[playerid][13], 0);
- PlayerTextDrawSetPreviewModel(playerid, __playerInvTD[playerid][13], -1);
- PlayerTextDrawSetPreviewRot(playerid, __playerInvTD[playerid][13], 0.000, 0.000, 0.000, 1.000);
- PlayerTextDrawSetPreviewVehCol(playerid, __playerInvTD[playerid][13], 0, 0);
- PlayerTextDrawSetSelectable(playerid, __playerInvTD[playerid][13], 1);
- __playerInvTD[playerid][14] = CreatePlayerTextDraw(playerid, 297.000, 337.000, "_");
- PlayerTextDrawTextSize(playerid, __playerInvTD[playerid][14], 70.000, 70.000);
- PlayerTextDrawAlignment(playerid, __playerInvTD[playerid][14], 1);
- PlayerTextDrawColor(playerid, __playerInvTD[playerid][14], -1);
- PlayerTextDrawSetShadow(playerid, __playerInvTD[playerid][14], 0);
- PlayerTextDrawSetOutline(playerid, __playerInvTD[playerid][14], 0);
- PlayerTextDrawBackgroundColor(playerid, __playerInvTD[playerid][14], 1887473789);
- PlayerTextDrawFont(playerid, __playerInvTD[playerid][14], 5);
- PlayerTextDrawSetProportional(playerid, __playerInvTD[playerid][14], 0);
- PlayerTextDrawSetPreviewModel(playerid, __playerInvTD[playerid][14], -1);
- PlayerTextDrawSetPreviewRot(playerid, __playerInvTD[playerid][14], 0.000, 0.000, 0.000, 1.000);
- PlayerTextDrawSetPreviewVehCol(playerid, __playerInvTD[playerid][14], 0, 0);
- PlayerTextDrawSetSelectable(playerid, __playerInvTD[playerid][14], 1);
- __playerInvTD[playerid][15] = CreatePlayerTextDraw(playerid, 369.000, 337.000, "_");
- PlayerTextDrawTextSize(playerid, __playerInvTD[playerid][15], 70.000, 70.000);
- PlayerTextDrawAlignment(playerid, __playerInvTD[playerid][15], 1);
- PlayerTextDrawColor(playerid, __playerInvTD[playerid][15], -1);
- PlayerTextDrawSetShadow(playerid, __playerInvTD[playerid][15], 0);
- PlayerTextDrawSetOutline(playerid, __playerInvTD[playerid][15], 0);
- PlayerTextDrawBackgroundColor(playerid, __playerInvTD[playerid][15], 1887473789);
- PlayerTextDrawFont(playerid, __playerInvTD[playerid][15], 5);
- PlayerTextDrawSetProportional(playerid, __playerInvTD[playerid][15], 0);
- PlayerTextDrawSetPreviewModel(playerid, __playerInvTD[playerid][15], -1);
- PlayerTextDrawSetPreviewRot(playerid, __playerInvTD[playerid][15], 0.000, 0.000, 0.000, 1.000);
- PlayerTextDrawSetPreviewVehCol(playerid, __playerInvTD[playerid][15], 0, 0);
- PlayerTextDrawSetSelectable(playerid, __playerInvTD[playerid][15], 1);
- __playerInvTD[playerid][16] = CreatePlayerTextDraw(playerid, 157.000, 247.000, "0");
- PlayerTextDrawLetterSize(playerid, __playerInvTD[playerid][16], 0.300, 1.500);
- PlayerTextDrawAlignment(playerid, __playerInvTD[playerid][16], 1);
- PlayerTextDrawColor(playerid, __playerInvTD[playerid][16], -1);
- PlayerTextDrawSetShadow(playerid, __playerInvTD[playerid][16], 1);
- PlayerTextDrawSetOutline(playerid, __playerInvTD[playerid][16], 1);
- PlayerTextDrawBackgroundColor(playerid, __playerInvTD[playerid][16], 150);
- PlayerTextDrawFont(playerid, __playerInvTD[playerid][16], 1);
- PlayerTextDrawSetProportional(playerid, __playerInvTD[playerid][16], 1);
- __playerInvTD[playerid][17] = CreatePlayerTextDraw(playerid, 229.000, 247.000, "0");
- PlayerTextDrawLetterSize(playerid, __playerInvTD[playerid][17], 0.300, 1.500);
- PlayerTextDrawAlignment(playerid, __playerInvTD[playerid][17], 1);
- PlayerTextDrawColor(playerid, __playerInvTD[playerid][17], -1);
- PlayerTextDrawSetShadow(playerid, __playerInvTD[playerid][17], 1);
- PlayerTextDrawSetOutline(playerid, __playerInvTD[playerid][17], 1);
- PlayerTextDrawBackgroundColor(playerid, __playerInvTD[playerid][17], 150);
- PlayerTextDrawFont(playerid, __playerInvTD[playerid][17], 1);
- PlayerTextDrawSetProportional(playerid, __playerInvTD[playerid][17], 1);
- __playerInvTD[playerid][18] = CreatePlayerTextDraw(playerid, 301.000, 247.000, "0");
- PlayerTextDrawLetterSize(playerid, __playerInvTD[playerid][18], 0.300, 1.500);
- PlayerTextDrawAlignment(playerid, __playerInvTD[playerid][18], 1);
- PlayerTextDrawColor(playerid, __playerInvTD[playerid][18], -1);
- PlayerTextDrawSetShadow(playerid, __playerInvTD[playerid][18], 1);
- PlayerTextDrawSetOutline(playerid, __playerInvTD[playerid][18], 1);
- PlayerTextDrawBackgroundColor(playerid, __playerInvTD[playerid][18], 150);
- PlayerTextDrawFont(playerid, __playerInvTD[playerid][18], 1);
- PlayerTextDrawSetProportional(playerid, __playerInvTD[playerid][18], 1);
- __playerInvTD[playerid][19] = CreatePlayerTextDraw(playerid, 373.000, 247.000, "0");
- PlayerTextDrawLetterSize(playerid, __playerInvTD[playerid][19], 0.300, 1.500);
- PlayerTextDrawAlignment(playerid, __playerInvTD[playerid][19], 1);
- PlayerTextDrawColor(playerid, __playerInvTD[playerid][19], -1);
- PlayerTextDrawSetShadow(playerid, __playerInvTD[playerid][19], 1);
- PlayerTextDrawSetOutline(playerid, __playerInvTD[playerid][19], 1);
- PlayerTextDrawBackgroundColor(playerid, __playerInvTD[playerid][19], 150);
- PlayerTextDrawFont(playerid, __playerInvTD[playerid][19], 1);
- PlayerTextDrawSetProportional(playerid, __playerInvTD[playerid][19], 1);
- __playerInvTD[playerid][20] = CreatePlayerTextDraw(playerid, 157.000, 319.000, "0");
- PlayerTextDrawLetterSize(playerid, __playerInvTD[playerid][20], 0.300, 1.500);
- PlayerTextDrawAlignment(playerid, __playerInvTD[playerid][20], 1);
- PlayerTextDrawColor(playerid, __playerInvTD[playerid][20], -1);
- PlayerTextDrawSetShadow(playerid, __playerInvTD[playerid][20], 1);
- PlayerTextDrawSetOutline(playerid, __playerInvTD[playerid][20], 1);
- PlayerTextDrawBackgroundColor(playerid, __playerInvTD[playerid][20], 150);
- PlayerTextDrawFont(playerid, __playerInvTD[playerid][20], 1);
- PlayerTextDrawSetProportional(playerid, __playerInvTD[playerid][20], 1);
- __playerInvTD[playerid][21] = CreatePlayerTextDraw(playerid, 229.000, 319.000, "0");
- PlayerTextDrawLetterSize(playerid, __playerInvTD[playerid][21], 0.300, 1.500);
- PlayerTextDrawAlignment(playerid, __playerInvTD[playerid][21], 1);
- PlayerTextDrawColor(playerid, __playerInvTD[playerid][21], -1);
- PlayerTextDrawSetShadow(playerid, __playerInvTD[playerid][21], 1);
- PlayerTextDrawSetOutline(playerid, __playerInvTD[playerid][21], 1);
- PlayerTextDrawBackgroundColor(playerid, __playerInvTD[playerid][21], 150);
- PlayerTextDrawFont(playerid, __playerInvTD[playerid][21], 1);
- PlayerTextDrawSetProportional(playerid, __playerInvTD[playerid][21], 1);
- __playerInvTD[playerid][22] = CreatePlayerTextDraw(playerid, 301.000, 319.000, "0");
- PlayerTextDrawLetterSize(playerid, __playerInvTD[playerid][22], 0.300, 1.500);
- PlayerTextDrawAlignment(playerid, __playerInvTD[playerid][22], 1);
- PlayerTextDrawColor(playerid, __playerInvTD[playerid][22], -1);
- PlayerTextDrawSetShadow(playerid, __playerInvTD[playerid][22], 1);
- PlayerTextDrawSetOutline(playerid, __playerInvTD[playerid][22], 1);
- PlayerTextDrawBackgroundColor(playerid, __playerInvTD[playerid][22], 150);
- PlayerTextDrawFont(playerid, __playerInvTD[playerid][22], 1);
- PlayerTextDrawSetProportional(playerid, __playerInvTD[playerid][22], 1);
- __playerInvTD[playerid][23] = CreatePlayerTextDraw(playerid, 373.000, 319.000, "0");
- PlayerTextDrawLetterSize(playerid, __playerInvTD[playerid][23], 0.300, 1.500);
- PlayerTextDrawAlignment(playerid, __playerInvTD[playerid][23], 1);
- PlayerTextDrawColor(playerid, __playerInvTD[playerid][23], -1);
- PlayerTextDrawSetShadow(playerid, __playerInvTD[playerid][23], 1);
- PlayerTextDrawSetOutline(playerid, __playerInvTD[playerid][23], 1);
- PlayerTextDrawBackgroundColor(playerid, __playerInvTD[playerid][23], 150);
- PlayerTextDrawFont(playerid, __playerInvTD[playerid][23], 1);
- PlayerTextDrawSetProportional(playerid, __playerInvTD[playerid][23], 1);
- __playerInvTD[playerid][24] = CreatePlayerTextDraw(playerid, 157.000, 391.000, "0");
- PlayerTextDrawLetterSize(playerid, __playerInvTD[playerid][24], 0.300, 1.500);
- PlayerTextDrawAlignment(playerid, __playerInvTD[playerid][24], 1);
- PlayerTextDrawColor(playerid, __playerInvTD[playerid][24], -1);
- PlayerTextDrawSetShadow(playerid, __playerInvTD[playerid][24], 1);
- PlayerTextDrawSetOutline(playerid, __playerInvTD[playerid][24], 1);
- PlayerTextDrawBackgroundColor(playerid, __playerInvTD[playerid][24], 150);
- PlayerTextDrawFont(playerid, __playerInvTD[playerid][24], 1);
- PlayerTextDrawSetProportional(playerid, __playerInvTD[playerid][24], 1);
- __playerInvTD[playerid][25] = CreatePlayerTextDraw(playerid, 229.000, 391.000, "0");
- PlayerTextDrawLetterSize(playerid, __playerInvTD[playerid][25], 0.300, 1.500);
- PlayerTextDrawAlignment(playerid, __playerInvTD[playerid][25], 1);
- PlayerTextDrawColor(playerid, __playerInvTD[playerid][25], -1);
- PlayerTextDrawSetShadow(playerid, __playerInvTD[playerid][25], 1);
- PlayerTextDrawSetOutline(playerid, __playerInvTD[playerid][25], 1);
- PlayerTextDrawBackgroundColor(playerid, __playerInvTD[playerid][25], 150);
- PlayerTextDrawFont(playerid, __playerInvTD[playerid][25], 1);
- PlayerTextDrawSetProportional(playerid, __playerInvTD[playerid][25], 1);
- __playerInvTD[playerid][26] = CreatePlayerTextDraw(playerid, 301.000, 391.000, "0");
- PlayerTextDrawLetterSize(playerid, __playerInvTD[playerid][26], 0.300, 1.500);
- PlayerTextDrawAlignment(playerid, __playerInvTD[playerid][26], 1);
- PlayerTextDrawColor(playerid, __playerInvTD[playerid][26], -1);
- PlayerTextDrawSetShadow(playerid, __playerInvTD[playerid][26], 1);
- PlayerTextDrawSetOutline(playerid, __playerInvTD[playerid][26], 1);
- PlayerTextDrawBackgroundColor(playerid, __playerInvTD[playerid][26], 150);
- PlayerTextDrawFont(playerid, __playerInvTD[playerid][26], 1);
- PlayerTextDrawSetProportional(playerid, __playerInvTD[playerid][26], 1);
- __playerInvTD[playerid][27] = CreatePlayerTextDraw(playerid, 373.000, 391.000, "0");
- PlayerTextDrawLetterSize(playerid, __playerInvTD[playerid][27], 0.300, 1.500);
- PlayerTextDrawAlignment(playerid, __playerInvTD[playerid][27], 1);
- PlayerTextDrawColor(playerid, __playerInvTD[playerid][27], -1);
- PlayerTextDrawSetShadow(playerid, __playerInvTD[playerid][27], 1);
- PlayerTextDrawSetOutline(playerid, __playerInvTD[playerid][27], 1);
- PlayerTextDrawBackgroundColor(playerid, __playerInvTD[playerid][27], 150);
- PlayerTextDrawFont(playerid, __playerInvTD[playerid][27], 1);
- PlayerTextDrawSetProportional(playerid, __playerInvTD[playerid][27], 1);
- return true;
- }
- static stock FixText(const string[])
- {
- new len = strlen(string), output[150];
- for(new i = 0; i < len; i ++)
- {
- switch(string[i])
- {
- case '%': output[i] = 37;
- case '&': output[i] = 38;
- case '¡': output[i] = 64;
- case '°': output[i] = 124;
- case 'À': output[i] = 128;
- case 'Á': output[i] = 129;
- case 'Â': output[i] = 130;
- case 'Ä', 'Ã': output[i] = 131;
- case 'Ç': output[i] = 133;
- case 'È': output[i] = 134;
- case 'É': output[i] = 135;
- case 'Ê': output[i] = 136;
- case 'Ë': output[i] = 137;
- case 'Ì': output[i] = 138;
- case 'Í': output[i] = 139;
- case 'Î': output[i] = 140;
- case 'Ï': output[i] = 141;
- case 'Ò': output[i] = 142;
- case 'Ó': output[i] = 143;
- case 'Ô': output[i] = 144;
- case 'Ö', 'Õ': output[i] = 145;
- case 'Ù': output[i] = 146;
- case 'Ú': output[i] = 147;
- case 'Û': output[i] = 148;
- case 'Ü': output[i] = 149;
- case 'à': output[i] = 151;
- case 'á': output[i] = 152;
- case 'â': output[i] = 153;
- case 'ä', 'ã': output[i] = 154;
- case 'ç': output[i] = 156;
- case 'è': output[i] = 157;
- case 'é': output[i] = 158;
- case 'ê': output[i] = 159;
- case 'ë': output[i] = 160;
- case 'ì': output[i] = 161;
- case 'í': output[i] = 162;
- case 'î': output[i] = 163;
- case 'ï': output[i] = 164;
- case 'ò': output[i] = 165;
- case 'ó': output[i] = 166;
- case 'ô': output[i] = 167;
- case 'ö', 'õ': output[i] = 168;
- case 'ù': output[i] = 169;
- case 'ú': output[i] = 170;
- case 'û': output[i] = 171;
- case 'ü': output[i] = 172;
- case 'Ñ': output[i] = 173;
- case 'ñ': output[i] = 174;
- case '¿': output[i] = 175;
- case '`': output[i] = 177;
- default: output[i] = string[i];
- }
- }
- return output;
- }
- // ---------------- HOOK ----------------
- #if defined _ALS_OnGameModeInit
- #undef OnGameModeInit
- #else
- #define _ALS_OnGameModeInit
- #endif
- #define OnGameModeInit td_invent_OnGameModeInit
- #if defined td_invent_OnGameModeInit
- forward td_invent_OnGameModeInit();
- #endif
- #if defined _ALS_OnPlayerDisconnect
- #undef OnPlayerDisconnect
- #else
- #define _ALS_OnPlayerDisconnect
- #endif
- #define OnPlayerDisconnect td_invent_OnPlayerDisconnect
- #if defined td_invent_OnPlayerDisconnect
- forward td_invent_OnPlayerDisconnect(playerid, reason);
- #endif
- #if defined _ALS_OnPlayerClickTextDraw
- #undef OnPlayerClickTextDraw
- #else
- #define _ALS_OnPlayerClickTextDraw
- #endif
- #define OnPlayerClickTextDraw inv_OnPlayerClickTextDraw
- #if defined inv_OnPlayerClickTextDraw
- forward inv_OnPlayerClickTextDraw(playerid, Text:clickedid);
- #endif
- #if defined _ALS_OnPlayerClickDynamicTextdr
- #undef OnPlayerClickDynamicTextdraw
- #else
- #define _ALS_OnPlayerClickDynamicTextdr
- #endif
- #define OnPlayerClickDynamicTextdraw invOnPlayerClickDynamicTextdraw
- #if defined invOnPlayerClickDynamicTextdraw
- forward invOnPlayerClickDynamicTextdraw(playerid, PlayerText:playertextid);
- #endif
- #if defined _ALS_OnPlayerKeyStateChange
- #undef OnPlayerKeyStateChange
- #else
- #define _ALS_OnPlayerKeyStateChange
- #endif
- #define OnPlayerKeyStateChange invent_OnPlayerKeyStateChange
- #if defined invent_OnPlayerKeyStateChange
- forward invent_OnPlayerKeyStateChange(playerid, newkeys, oldkeys);
- #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement