[Ajuda] Ajuda nesse comando.
#5

Quote:
Originally Posted by Equipe
Посмотреть сообщение
Garfield, usei a sua e a do lуs ,

bom o problema agora й que , diz ter 3 carros sendo que a pessoa nгo tem nem 1.

:S
Analisando seu cуdigo, encontrei alguns erros, refiz o cуdigo e parece estar funcional agora:

pawn Код:
if ( strcmp ( cmdtext, "/comprarcarro", true ) == 0 )
{
    new
        VehicleID = GetPlayerVehicleID(playerid) ,
        str_carro_1 [ 128 ] ,
        str_carro_2 [ 128 ] ,
        pname [ MAX_PLAYER_NAME ] ;
       
    format ( str_carro_1, sizeof ( str_carro_1 ) , "carro%d.ini", VehicleID ) ;
   
    GetPlayerName ( playerid, pname, sizeof ( pname ) ) ;

    for ( new carro = 0 ; carro < MAX_CARROS ; carro++ )
    {
        new
            int_player_cars [ MAX_PLAYERS ] ;
           
        format ( str_carro_2, sizeof ( str_carro_2 ) , "carro%d.ini", carro ) ;
       
        if ( strcmp ( dini_Get ( str_carro_2, "Dono" ), pname, true ) == 0)
            int_player_cars [ playerid ] ++;
       
        if ( int_player_cars [ playerid ] == 3 )
            return SendClientMessage( playerid, Vermelho, "Vocк ja tem 3 carros by mister!" ) ;
           
        else
            continue ;
    }
   
    if ( IsPlayerInAnyVehicle ( playerid ) && GetPlayerVehicleSeat ( playerid ) == 0 && VehicleID == dini_Int ( str_carro_1, "Id" ) )
    {
        if ( GetPlayerGrana ( playerid ) < dini_Int ( str_carro_1, "Preco" ) )
            return SendClientMessage ( playerid, Vermelho, "(ERRO) Vocк nгo tem dinheiro suficiente!" ) ;
           
        dini_IntSet ( str_carro_1, "TDono", 1 ) ;
        dini_Set ( str_carro_1, "Dono", pname ) ;
       
        GivePlayerGrana ( playerid, -dini_Int ( str_carro_1, "Preco" ) ) ;
        TogglePlayerControllable ( playerid, 1 ) ;
       
        SendClientMessage ( playerid, Violeta, "(INFO) Veiculo comprado com sucesso!" ) ;
        SendClientMessage ( playerid, Vermelho, "(INFO) Para ver os comandos do veiculo, use: /meucarro" ) ;       
    }
   
    return 1;
}
Reply


Messages In This Thread
Ajuda nesse comando. - by Equipe - 27.12.2012, 13:12
Re: Ajuda nesse comando. - by Lуs - 01.01.2013, 03:49
Re: Ajuda nesse comando. - by zSuYaNw - 01.01.2013, 04:00
Re: Ajuda nesse comando. - by Equipe - 01.01.2013, 12:12
Re: Ajuda nesse comando. - by Lуs - 01.01.2013, 15:17
Re: Ajuda nesse comando. - by Equipe - 01.01.2013, 16:19
Re: Ajuda nesse comando. - by Equipe - 02.01.2013, 01:35
Re: Ajuda nesse comando. - by Lуs - 02.01.2013, 03:16

Forum Jump:


Users browsing this thread: 3 Guest(s)