[Ajuda] Problema com carro de Inventбrio
#1

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.1100001);
    
SetPlayerAttachedObject(playerid91955950.0739990.1119990.091000, -152.600006, -2.80008121.500045111);
     }
     
    for(new 
0!= 7i++){
        
PlayerTextDrawShow(playeridinvText[playerid][i]);
     }
     
SelectTextDraw(playerid0x00FFFFFF);
    new 
str[256];
    
format(str,300,"Pagina_%d-5",InventarioPagina[playerid]);
    
PlayerTextDrawSetString(playerid,invText[playerid][4],str);
    new 
itens;
    for(new 
075i++){
        if(
InventarioInfo[playerid][i][iSlot] != 19382itens++;
        
format(strsizeof str"Inventario_de:_~b~~h~%s_~w~Itens:_~b~~h~%d/75"PlayerName(playerid), itens);
         
PlayerTextDrawSetString(playeridinvText[playerid][5], str);
    }
    
InventarioAberto[playerid] = 1;
    if(
InventarioPagina[playerid] == 1){
        for(new 
i=015i++){
            if(
InventarioInfo[playerid][i][iUnidades] > 0){
                
format(strsizeof str"%s ~b~~h~%d"NomeItemInvInventario(iplayerid), InventarioInfo[playerid][i][iUnidades]);
                
PlayerTextDrawSetString(playeridinvName[playerid][i], str);
                
PlayerTextDrawShow(playeridinvName[playerid][i]);
            }
            
PlayerTextDrawSetPreviewModel(playeridinvPreview[playerid][i], InventarioInfo[playerid][i][iSlot]);
            
PlayerTextDrawShow(playeridinvPreview[playerid][i]);
            if(
InventarioInfo[playerid][i][iSlot] == 11738 || InventarioInfo[playerid][i][iSlot] == 11739){
                
PlayerTextDrawSetPreviewModel(playeridinvPreview[playerid][i], 11736);
                
PlayerTextDrawShow(playeridinvPreview[playerid][i]);
            }
            if(
InventarioInfo[playerid][i][iSlot] == 19382){
                
PlayerTextDrawSetPreviewModel(playeridinvPreview[playerid][i], 18631);
                
PlayerTextDrawShow(playeridinvPreview[playerid][i]);
            }
        }
    }
    if(
InventarioPagina[playerid] == 2){
        for(new 
1530i++){
            if(
InventarioInfo[playerid][i][iUnidades] > 0){
                
format(strsizeof str"%s ~b~~h~%d"NomeItemInvInventario(iplayerid), InventarioInfo[playerid][i][iUnidades]);
                
PlayerTextDrawSetString(playeridinvName[playerid][i], str);
                
PlayerTextDrawShow(playeridinvName[playerid][i]);
            }
            
PlayerTextDrawSetPreviewModel(playeridinvPreview[playerid][i], InventarioInfo[playerid][i][iSlot]);
            
PlayerTextDrawShow(playeridinvPreview[playerid][i]);
            if(
InventarioInfo[playerid][i][iSlot] == 11738 || InventarioInfo[playerid][i][iSlot] == 11739){
                
PlayerTextDrawSetPreviewModel(playeridinvPreview[playerid][i], 11736);
                
PlayerTextDrawShow(playeridinvPreview[playerid][i]);
            }
            if(
InventarioInfo[playerid][i][iSlot] == 19382){
                
PlayerTextDrawSetPreviewModel(playeridinvPreview[playerid][i], 18631);
                
PlayerTextDrawShow(playeridinvPreview[playerid][i]);
            }
        }
    }
    if(
InventarioPagina[playerid] == 3){
        for(new 
i=30!= 45i++){
            if(
InventarioInfo[playerid][i][iUnidades] > 0){
                
format(strsizeof str"%s ~b~~h~%d"NomeItemInvInventario(iplayerid), InventarioInfo[playerid][i][iUnidades]);
                
PlayerTextDrawSetString(playeridinvName[playerid][i], str);
                
PlayerTextDrawShow(playeridinvName[playerid][i]);
            }
            
PlayerTextDrawSetPreviewModel(playeridinvPreview[playerid][i], InventarioInfo[playerid][i][iSlot]);
            
PlayerTextDrawShow(playeridinvPreview[playerid][i]);
            if(
InventarioInfo[playerid][i][iSlot] == 11738 || InventarioInfo[playerid][i][iSlot] == 11739){
                
PlayerTextDrawSetPreviewModel(playeridinvPreview[playerid][i], 11736);
                
PlayerTextDrawShow(playeridinvPreview[playerid][i]);
            }
               if(
InventarioInfo[playerid][i][iSlot] == 19382){
                
PlayerTextDrawSetPreviewModel(playeridinvPreview[playerid][i], 18631);
                
PlayerTextDrawShow(playeridinvPreview[playerid][i]);
            }
        }
    }
    if(
InventarioPagina[playerid] == 4){
        for(new 
i=45!= 60i++){
            if(
InventarioInfo[playerid][i][iUnidades] > 0){
                
format(strsizeof str"%s ~b~~h~%d"NomeItemInvInventario(iplayerid), InventarioInfo[playerid][i][iUnidades]);
                
PlayerTextDrawSetString(playeridinvName[playerid][i], str);
                
PlayerTextDrawShow(playeridinvName[playerid][i]);
            }
            
PlayerTextDrawSetPreviewModel(playeridinvPreview[playerid][i], InventarioInfo[playerid][i][iSlot]);
            
PlayerTextDrawShow(playeridinvPreview[playerid][i]);
            if(
InventarioInfo[playerid][i][iSlot] == 11738 || InventarioInfo[playerid][i][iSlot] == 11739){
                
PlayerTextDrawSetPreviewModel(playeridinvPreview[playerid][i], 11736);
                
PlayerTextDrawShow(playeridinvPreview[playerid][i]);
            }
            if(
InventarioInfo[playerid][i][iSlot] == 19382){
                
PlayerTextDrawSetPreviewModel(playeridinvPreview[playerid][i], 18631);
                
PlayerTextDrawShow(playeridinvPreview[playerid][i]);
            }
        }
    }
    if(
InventarioPagina[playerid] == 5){
        for(new 
i=60!= 75i++){
            if(
InventarioInfo[playerid][i][iUnidades] > 0){
                
format(strsizeof str"%s ~b~~h~%d"NomeItemInvInventario(iplayerid), InventarioInfo[playerid][i][iUnidades]);
                
PlayerTextDrawSetString(playeridinvName[playerid][i], str);
                
PlayerTextDrawShow(playeridinvName[playerid][i]);
            }
            
PlayerTextDrawSetPreviewModel(playeridinvPreview[playerid][i], InventarioInfo[playerid][i][iSlot]);
            
PlayerTextDrawShow(playeridinvPreview[playerid][i]);
            if(
InventarioInfo[playerid][i][iSlot] == 11738 || InventarioInfo[playerid][i][iSlot] == 11739){
                
PlayerTextDrawSetPreviewModel(playeridinvPreview[playerid][i], 11736);
                
PlayerTextDrawShow(playeridinvPreview[playerid][i]);
            }
            if(
InventarioInfo[playerid][i][iSlot] == 19382){
                
PlayerTextDrawSetPreviewModel(playeridinvPreview[playerid][i], 18631);
                
PlayerTextDrawShow(playeridinvPreview[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(playerid9);
    for(new 
0!= 16i++){
        
PlayerTextDrawHide(playeridinvText[playerid][i]);
     }
    for(new 
i!= 75i++){
        
PlayerTextDrawHide(playeridinvPreview[playerid][i]);
        
PlayerTextDrawHide(playeridinvName[playerid][i]);
     }

PHP код:
    if(newkeys KEY_NO)
    {
        
cmd_inventario(playerid);
          
Sound(playerid103930.0);
          
DestroyVehicle(RC[playerid]);
    } 
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)