SA-MP Forums Archive
[Ajuda] erro em cobrar money ajudem pfv - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] erro em cobrar money ajudem pfv (/showthread.php?tid=646706)



erro em cobrar money ajudem pfv - tcharles2011 - 22.12.2017

PHP код:
    new VRC[11];
public 
OnGameModeInit()
{
    
VRC[0] = AddStaticVehicleEx(510, 1730.5958, -1714.8099, 13.1575, 134.0000, 226,226,60);
    
VRC[1] = AddStaticVehicleEx(510, 1729.9027, -1714.1460, 13.1575, 134.0000, 226,226,60);
    
VRC[2] = AddStaticVehicleEx(510, 1729.1782, -1713.3990, 13.1575, 134.0000, 226,226,60);
    
VRC[3] = AddStaticVehicleEx(510, 1728.4216, -1712.6520, 13.1575, 134.0000, 226,226,60);
    
VRC[4] = AddStaticVehicleEx(510, 1727.6616, -1711.8744, 13.1575, 134.0000, 226,226,60);
    
VRC[6] = AddStaticVehicleEx(510, 1712.6514, -1715.0088, 13.1575, 224.0000, 6,6,60);
    
VRC[7] = AddStaticVehicleEx(510, 1713.3564, -1714.3573, 13.1575, 224.0000, 6,6,60);
    
VRC[8] = AddStaticVehicleEx(510, 1714.0463, -1713.7191, 13.1575, 224.0000, 6,6,60);
    
VRC[9] = AddStaticVehicleEx(510, 1714.7125, -1713.0839, 13.1575, 224.0000, 6,6,60);
    
VRC[10] = AddStaticVehicleEx(510, 1715.3793, -1712.4772, 13.1575, 224.0000, 6,6,60);
    for(new 
rcv; rcv < MAX_VEHICLES; rcv++)
    {
        if(
rcv >= VRC[0] && rcv <= VRC[sizeof(VRC)-1])
        {
             
format(STRX, sizeof(STRX), "{7CFC00}%s\n{FFFFFF}•• Veнculo Publico ••", veehName[GetVehicleModel(rcv)-400]);
            new 
Text3D:d3d = Create3DTextLabel(STRX, 0xFFFFFFFF, 0.0, 0.0, 0.0, 10.0, 0);
            
Attach3DTextLabelToVehicle(d3d, rcv, 0.0, 0.0, 0.0);
            
GivePlayerGrana(playerid, -400);
        }
    } 
este й um sistema de alugar carros publicos, mais eu queria que ele cobrase uma taxa de 400 para alguem pegar estes veiculos.
ERRO:
: error 017: undefined symbol "playerid"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Error.


Re: erro em cobrar money ajudem pfv - Gguiz - 22.12.2017

PHP код:
new VRC[11];
public 
OnGameModeInit()
{
    
VRC[0] = AddStaticVehicleEx(510, 1730.5958, -1714.8099, 13.1575, 134.0000, 226,226,60);
    
VRC[1] = AddStaticVehicleEx(510, 1729.9027, -1714.1460, 13.1575, 134.0000, 226,226,60);
    
VRC[2] = AddStaticVehicleEx(510, 1729.1782, -1713.3990, 13.1575, 134.0000, 226,226,60);
    
VRC[3] = AddStaticVehicleEx(510, 1728.4216, -1712.6520, 13.1575, 134.0000, 226,226,60);
    
VRC[4] = AddStaticVehicleEx(510, 1727.6616, -1711.8744, 13.1575, 134.0000, 226,226,60);
    
VRC[6] = AddStaticVehicleEx(510, 1712.6514, -1715.0088, 13.1575, 224.0000, 6,6,60);
    
VRC[7] = AddStaticVehicleEx(510, 1713.3564, -1714.3573, 13.1575, 224.0000, 6,6,60);
    
VRC[8] = AddStaticVehicleEx(510, 1714.0463, -1713.7191, 13.1575, 224.0000, 6,6,60);
    
VRC[9] = AddStaticVehicleEx(510, 1714.7125, -1713.0839, 13.1575, 224.0000, 6,6,60);
    
VRC[10] = AddStaticVehicleEx(510, 1715.3793, -1712.4772, 13.1575, 224.0000, 6,6,60);
    for(new 
rcv; rcv < MAX_VEHICLES; rcv++)
    {
        if(
rcv >= VRC[0] && rcv <= VRC[sizeof(VRC)-1])
        {
             
format(STRX, sizeof(STRX), "{7CFC00}%s\n{FFFFFF}•• Veнculo Publico ••", veehName[GetVehicleModel(rcv)-400]);
            new 
Text3D:d3d = Create3DTextLabel(STRX, 0xFFFFFFFF, 0.0, 0.0, 0.0, 10.0, 0);
            
Attach3DTextLabelToVehicle(d3d, rcv, 0.0, 0.0, 0.0);
            
GivePlayerMoney (playerid, -400) ;
        }
    }
    return 
1;
} 



Re: erro em cobrar money ajudem pfv - tcharles2011 - 22.12.2017

Continuou sem cobrar nada denovo


Re: erro em cobrar money ajudem pfv - Gguiz - 22.12.2017

@Edit

Editei o tуpico, teste agora.


Re: erro em cobrar money ajudem pfv - tcharles2011 - 22.12.2017

(4474) : warning 217: loose indentation
(4476) : warning 217: loose indentation
(4476) : error 017: undefined symbol "RewardPlayer"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Error.


Re: erro em cobrar money ajudem pfv - tcharles2011 - 22.12.2017

Ainda nгo estou conseguindo achar uma maneira de cobrar esta taixa para o jogador usar este veiculo


Re: erro em cobrar money ajudem pfv - Gguiz - 22.12.2017

Perdгo, pensei que funзгo "RewardPlayer" fosse nativa do SA-MP, substitua ela por:
PHP код:
GivePlayerMoney (playerid, -400); 
Pela lуgica vai funcionar, testa aн.


Re: erro em cobrar money ajudem pfv - tcharles2011 - 22.12.2017

Porem ai da o erro do playerid