14.08.2018, 21:56
Meu problema й o seguinte, quando eu pego um carro de inventario e o outro player tenta pegar o dele, o meu carro some e volta pro meu inventбrio. As vezes, acontece de atй duas pessoas conseguir usar o carro de inventбrio. As vezes acontece deu estar com o meu carro de INV e um outro player apertar N, o meu carro sumir e voltar pro INV. O que pode ser? Vou mandar abaixo algumas partes dos meu cуdigos, se precisar de mais eu mando.
PHP код:
CMD:inventario(playerid){
if(PlayerInfo[playerid][pJailed] != 0)
{
SendClientMessage(playerid,COLOR_YELLOW," Vocк nгo pode usar este comando na cadeia!");
return true;
}
AbrirInventario(playerid);
return 1;
}
PHP код:
stock AbrirInventario(playerid){
if(!IsPlayerInAnyVehicle(playerid))
{
ApplyAnimation(playerid, "BOMBER", "BOM_Plant_Loop", 4.1, 1, 0, 0, 0, 0, 1);
SetPlayerAttachedObject(playerid, 9, 19559, 5, 0.073999, 0.111999, 0.091000, -152.600006, -2.80008, 121.500045, 1, 1, 1);
}
for(new i = 0; i != 7; i++){
PlayerTextDrawShow(playerid, invText[playerid][i]);
}
SelectTextDraw(playerid, 0x00FFFFFF);
new str[256];
format(str,300,"Pagina_%d-5",InventarioPagina[playerid]);
PlayerTextDrawSetString(playerid,invText[playerid][4],str);
new itens;
for(new i = 0; i < 75; i++){
if(InventarioInfo[playerid][i][iSlot] != 19382) itens++;
format(str, sizeof str, "Inventario_de:_~b~~h~%s_~w~Itens:_~b~~h~%d/75", PlayerName(playerid), itens);
PlayerTextDrawSetString(playerid, invText[playerid][5], str);
}
InventarioAberto[playerid] = 1;
if(InventarioPagina[playerid] == 1){
for(new i=0; i < 15; i++){
if(InventarioInfo[playerid][i][iUnidades] > 0){
format(str, sizeof str, "%s ~b~~h~%d", NomeItemInvInventario(i, playerid), InventarioInfo[playerid][i][iUnidades]);
PlayerTextDrawSetString(playerid, invName[playerid][i], str);
PlayerTextDrawShow(playerid, invName[playerid][i]);
}
PlayerTextDrawSetPreviewModel(playerid, invPreview[playerid][i], InventarioInfo[playerid][i][iSlot]);
PlayerTextDrawShow(playerid, invPreview[playerid][i]);
if(InventarioInfo[playerid][i][iSlot] == 11738 || InventarioInfo[playerid][i][iSlot] == 11739){
PlayerTextDrawSetPreviewModel(playerid, invPreview[playerid][i], 11736);
PlayerTextDrawShow(playerid, invPreview[playerid][i]);
}
if(InventarioInfo[playerid][i][iSlot] == 19382){
PlayerTextDrawSetPreviewModel(playerid, invPreview[playerid][i], 18631);
PlayerTextDrawShow(playerid, invPreview[playerid][i]);
}
}
}
if(InventarioPagina[playerid] == 2){
for(new i = 15; i < 30; i++){
if(InventarioInfo[playerid][i][iUnidades] > 0){
format(str, sizeof str, "%s ~b~~h~%d", NomeItemInvInventario(i, playerid), InventarioInfo[playerid][i][iUnidades]);
PlayerTextDrawSetString(playerid, invName[playerid][i], str);
PlayerTextDrawShow(playerid, invName[playerid][i]);
}
PlayerTextDrawSetPreviewModel(playerid, invPreview[playerid][i], InventarioInfo[playerid][i][iSlot]);
PlayerTextDrawShow(playerid, invPreview[playerid][i]);
if(InventarioInfo[playerid][i][iSlot] == 11738 || InventarioInfo[playerid][i][iSlot] == 11739){
PlayerTextDrawSetPreviewModel(playerid, invPreview[playerid][i], 11736);
PlayerTextDrawShow(playerid, invPreview[playerid][i]);
}
if(InventarioInfo[playerid][i][iSlot] == 19382){
PlayerTextDrawSetPreviewModel(playerid, invPreview[playerid][i], 18631);
PlayerTextDrawShow(playerid, invPreview[playerid][i]);
}
}
}
if(InventarioPagina[playerid] == 3){
for(new i=30; i != 45; i++){
if(InventarioInfo[playerid][i][iUnidades] > 0){
format(str, sizeof str, "%s ~b~~h~%d", NomeItemInvInventario(i, playerid), InventarioInfo[playerid][i][iUnidades]);
PlayerTextDrawSetString(playerid, invName[playerid][i], str);
PlayerTextDrawShow(playerid, invName[playerid][i]);
}
PlayerTextDrawSetPreviewModel(playerid, invPreview[playerid][i], InventarioInfo[playerid][i][iSlot]);
PlayerTextDrawShow(playerid, invPreview[playerid][i]);
if(InventarioInfo[playerid][i][iSlot] == 11738 || InventarioInfo[playerid][i][iSlot] == 11739){
PlayerTextDrawSetPreviewModel(playerid, invPreview[playerid][i], 11736);
PlayerTextDrawShow(playerid, invPreview[playerid][i]);
}
if(InventarioInfo[playerid][i][iSlot] == 19382){
PlayerTextDrawSetPreviewModel(playerid, invPreview[playerid][i], 18631);
PlayerTextDrawShow(playerid, invPreview[playerid][i]);
}
}
}
if(InventarioPagina[playerid] == 4){
for(new i=45; i != 60; i++){
if(InventarioInfo[playerid][i][iUnidades] > 0){
format(str, sizeof str, "%s ~b~~h~%d", NomeItemInvInventario(i, playerid), InventarioInfo[playerid][i][iUnidades]);
PlayerTextDrawSetString(playerid, invName[playerid][i], str);
PlayerTextDrawShow(playerid, invName[playerid][i]);
}
PlayerTextDrawSetPreviewModel(playerid, invPreview[playerid][i], InventarioInfo[playerid][i][iSlot]);
PlayerTextDrawShow(playerid, invPreview[playerid][i]);
if(InventarioInfo[playerid][i][iSlot] == 11738 || InventarioInfo[playerid][i][iSlot] == 11739){
PlayerTextDrawSetPreviewModel(playerid, invPreview[playerid][i], 11736);
PlayerTextDrawShow(playerid, invPreview[playerid][i]);
}
if(InventarioInfo[playerid][i][iSlot] == 19382){
PlayerTextDrawSetPreviewModel(playerid, invPreview[playerid][i], 18631);
PlayerTextDrawShow(playerid, invPreview[playerid][i]);
}
}
}
if(InventarioPagina[playerid] == 5){
for(new i=60; i != 75; i++){
if(InventarioInfo[playerid][i][iUnidades] > 0){
format(str, sizeof str, "%s ~b~~h~%d", NomeItemInvInventario(i, playerid), InventarioInfo[playerid][i][iUnidades]);
PlayerTextDrawSetString(playerid, invName[playerid][i], str);
PlayerTextDrawShow(playerid, invName[playerid][i]);
}
PlayerTextDrawSetPreviewModel(playerid, invPreview[playerid][i], InventarioInfo[playerid][i][iSlot]);
PlayerTextDrawShow(playerid, invPreview[playerid][i]);
if(InventarioInfo[playerid][i][iSlot] == 11738 || InventarioInfo[playerid][i][iSlot] == 11739){
PlayerTextDrawSetPreviewModel(playerid, invPreview[playerid][i], 11736);
PlayerTextDrawShow(playerid, invPreview[playerid][i]);
}
if(InventarioInfo[playerid][i][iSlot] == 19382){
PlayerTextDrawSetPreviewModel(playerid, invPreview[playerid][i], 18631);
PlayerTextDrawShow(playerid, invPreview[playerid][i]);
}
}
}
return 1;
}
stock FecharInventario(playerid){
InventarioAberto[playerid] = 0;
CancelSelectTextDraw(playerid);
if(!IsPlayerInAnyVehicle(playerid)) ClearAnimations(playerid);
if(!IsPlayerInAnyVehicle(playerid)) SetPlayerSpecialAction(playerid,SPECIAL_ACTION_NONE);
RemovePlayerAttachedObject(playerid, 9);
for(new i = 0; i != 16; i++){
PlayerTextDrawHide(playerid, invText[playerid][i]);
}
for(new i; i != 75; i++){
PlayerTextDrawHide(playerid, invPreview[playerid][i]);
PlayerTextDrawHide(playerid, invName[playerid][i]);
}
}
PHP код:
if(newkeys & KEY_NO)
{
cmd_inventario(playerid);
Sound(playerid, 1039, 30.0);
DestroyVehicle(RC[playerid]);
}