22/06/2023 00:37
(Esta mensagem foi modificada pela última vez a: 22/06/2023 00:45 por RosaScripter.)
Fazer com que inves de abrir meu inventario, abrir do ID mencionado. Fiz algumas formas mas estou errado as var (coisa de iniciante) mas todo mundo tem uma dificuldade. xD
codigo padrão
codigo para ver inv de outro jogador
inv q eu uso https://pastebin.com/N5iSuQYg
codigo padrão
Código:
CMD:inventario(playerid)
{
new str[64];
if(InventarioAberto[playerid])
{
for(new i = 0; i < 40; ++i)
{
PlayerTextDrawHide(playerid, DrawInv[playerid][i]);
}
InventarioAberto[playerid] = 0;
CancelSelectTextDraw(playerid);
format(str, sizeof(str), "{FFFFFF}*{FF0000}%s {FFFFFF}cerro su inventario.", Name(playerid));
SendClientMessageInRange(10, playerid, str, 0xB384FFAA,0xB384FFAA,0xB384FFAA,0xB384FFAA,0xB384FFAA);
return 1;
}
else
{
format(str, sizeof(str), "Inventario: %s", Name(playerid));
PlayerTextDrawSetString(playerid, DrawInv[playerid][34], str);
PlayerTextDrawSetString(playerid, DrawInv[playerid][38], "");
for(new i = 1; i < 33; ++i)
{
PlayerTextDrawSetPreviewModel(playerid, DrawInv[playerid][i], PlayerInventario[playerid][i][Slot]);
if(PlayerInventario[playerid][i][Slot] == -1)
{
PlayerTextDrawSetPreviewRot(playerid, DrawInv[playerid][i], 0.000000, 0.000000, 0.000000, 999);
}
else
{
PlayerTextDrawSetPreviewRot(playerid, DrawInv[playerid][i], 0.000000, 0.000000, 0.000000, 1);
}
}
for(new i = 0; i < 40; ++i)
{
PlayerTextDrawShow(playerid, DrawInv[playerid][i]);
}
SelectTextDraw(playerid, 0xC4C4C4AA);
InventarioAberto[playerid] = 1;
format(str, sizeof(str), "{FFFFFF}*{FF0000}%s {FFFFFF}abrio su inventario.", Name(playerid));
SendClientMessageInRange(10, playerid, str, 0xB384FFAA,0xB384FFAA,0xB384FFAA,0xB384FFAA,0xB384FFAA);
}
return 1;
}
codigo para ver inv de outro jogador
Código:
CMD:mirainv(playerid, params[])
{
new str[64];
if(!IsPolicial(playerid)) return notification.Show(playerid, "ERRO", "No tienes permision.", ICONE_ERRO);
if(Patrulha[playerid] == false) return notification.Show(playerid, "ERRO", "No estas en patrulla.", ICONE_ERRO);
if(sscanf(params, "d", ID)) return SendClientMessage(playerid, CorErroNeutro, "USE: /mirainv [ID]");
if(!IsPlayerConnected(ID)) return notification.Show(playerid, "ERRO", "Jugador no estas en linea.", ICONE_ERRO);
if(!IsPerto(playerid,ID))return notification.Show(playerid, "ERRO", "No estas cerca de este jugador.", ICONE_ERRO);
if(InventarioAberto[playerid])
{
for(new i = 0; i < 40; ++i)
{
PlayerTextDrawHide(playerid, DrawInv[playerid][i]);
}
InventarioAberto[playerid] = 0;
CancelSelectTextDraw(playerid);
format(str, sizeof(str), "{FFFFFF}*{FF0000}%s {FFFFFF}cerro su inventario.", Name(playerid));
SendClientMessageInRange(10, playerid, str, 0xB384FFAA,0xB384FFAA,0xB384FFAA,0xB384FFAA,0xB384FFAA);
return 1;
}
else
{
format(str, sizeof(str), "Inventario: %s", Name(playerid));
PlayerTextDrawSetString(playerid, DrawInv[playerid][34], str);
PlayerTextDrawSetString(playerid, DrawInv[playerid][38], "");
for(new i = 1; i < 33; ++i)
{
PlayerTextDrawSetPreviewModel(playerid, DrawInv[playerid][i], PlayerInventario[playerid][i][Slot]);
if(PlayerInventario[playerid][i][Slot] == -1)
{
PlayerTextDrawSetPreviewRot(playerid, DrawInv[playerid][i], 0.000000, 0.000000, 0.000000, 999);
}
else
{
PlayerTextDrawSetPreviewRot(playerid, DrawInv[playerid][i], 0.000000, 0.000000, 0.000000, 1);
}
}
for(new i = 0; i < 40; ++i)
{
PlayerTextDrawShow(playerid, DrawInv[playerid][i]);
}
SelectTextDraw(playerid, 0xC4C4C4AA);
InventarioAberto[playerid] = 1;
format(str, sizeof(str), "{FFFFFF}*{FF0000}%s {FFFFFF}abrio su inventario.", Name(playerid));
SendClientMessageInRange(10, playerid, str, 0xB384FFAA,0xB384FFAA,0xB384FFAA,0xB384FFAA,0xB384FFAA);
}
return 1;
}
inv q eu uso https://pastebin.com/N5iSuQYg