SA-MP Forums Archive
[AJUDA]Simples (pra mim nгo й) - 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]Simples (pra mim nгo й) (/showthread.php?tid=185259)



[RESOLVIDO]Probleminha Simples - wforest - 23.10.2010

Simples porem enchem o meu saco....

1Є) Quando eu entro no carro nгo aparece a mensagem a mensagem do preзo e nome do carro ...
pawn Код:
if(newstate==2)
    {
        for(new i = 0; i < sizeof(CarInfo); i++)
        {
            new newcar = GetPlayerVehicleID(playerid);
            if(newcar == CarInfo[i][ownedvehicle])
            {
                if(CarInfo[i][cOwned]==0)
                {
                    TogglePlayerControllable(playerid, 0);
                    CarOffered[playerid]=1;
                    format(string,sizeof(string),"~w~Carro: %s~n~Preзo: ~g~%d~n~~w~/Veiculo Comprar para comprar este veiculo!",CarInfo[i][cDescription],CarInfo[i][cValue]);
                    GameTextForPlayer(playerid, string, 5000, 3);
                }
            }
        }
    }
PROBLEMA RESOLVIDO(coloquei sendclientmensage ao invйs de gametextforplayer) :
pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(newstate==2)
    {
        for(new i = 0; i < sizeof(CarInfo); i++)
        {
            new newcar = GetPlayerVehicleID(playerid);
            if(newcar == CarInfo[i][ownedvehicle])
            {
                if(CarInfo[i][cOwned]==0)
                {
                    TogglePlayerControllable(playerid, 0);
                    CarOffered[playerid]=1;
                    format(string, sizeof(string), "Para Comprar este veiculo, Use ((/Veiculo comprar)).");
                    SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
                }
            }
        }
    }



Re: [AJUDA]Simples (pra mim nгo й) - TiagoPS - 23.10.2010

Tenta Assim Nгo Sei Se Vai Funcionar

pawn Код:
if(newstate== IsPlayerInAniVehicle(playerid))
    {
        for(new i = 0; i < sizeof(CarInfo); i++)
        {
            new newcar = GetPlayerVehicleID(playerid);
            if(newcar == CarInfo[i][ownedvehicle])
            {
                if(CarInfo[i][cOwned]==0)
                {
                    TogglePlayerControllable(playerid, 0);
                    CarOffered[playerid]=1;
                    format(string,sizeof(string),"~w~Carro: %s~n~Preзo: ~g~%d~n~~w~/Veiculo Comprar para comprar este veiculo!",CarInfo[i][cDescription],CarInfo[i][cValue]);
                    GameTextForPlayer(playerid, string, 5000, 3);
                }
            }
        }
    }



Re: [AJUDA]Simples (pra mim nгo й) - wforest - 23.10.2010

vc queria dizer "IsPlayerInAnyvehicle" neh sokakosako
pawn Код:
if(newstate== IsPlayerInAnyVehicle(playerid))
    {
        for(new i = 0; i < sizeof(CarInfo); i++)
        {
            new newcar = GetPlayerVehicleID(playerid);
            if(newcar == CarInfo[i][ownedvehicle])
            {
                if(CarInfo[i][cOwned]==0)
                {
                    TogglePlayerControllable(playerid, 0);
                    CarOffered[playerid]=1;
                    format(string,sizeof(string),"~w~Carro: %s~n~Preзo: ~g~%d~n~~w~/Veiculo Comprar para comprar este veiculo!",CarInfo[i][cDescription],CarInfo[i][cValue]);
                    GameTextForPlayer(playerid, string, 5000, 3);
                }
            }
        }
    }
@EDIT
man .. nгo foi nгo .. da pra entrar e sair andando com o carro ... e msm assim a msg num aparece...


Re: [AJUDA]Simples (pra mim nгo й) - Macintosh - 23.10.2010

acho que й em Public OnPlayerEnterVehicle!
Verifique!


Re: [AJUDA]Simples (pra mim nгo й) - wforest - 23.10.2010

agora a mensagem aparece mas antes de entrar no carro e.e ...ai o "boneco" trava antes de entrar...


Re: [AJUDA]Simples (pra mim nгo й) - Macintosh - 23.10.2010

pawn Код:
public OnPlayerEnterVehicle
{
TogglePlayerControllable(playerid, 1);
return 1;
}



Re: [AJUDA]Simples (pra mim nгo й) - wforest - 23.10.2010

isso eh pra botar no comeзo do Onplayerentervehicle ?

ou modificar o codigo ali do "0" pra "1" ?

pq eu fui colocar no comeзo do onplayerentervehicle travo o pawn ! oO ?SKOAKOSAKO


vo testa medificando o codigo ali..

@EDIT ....

o "boneco" nгo entra no carro..... mas ele tbm n trava ... sokasokaoks e agr ??

eu pensei em botar so o gametextforplayer em "onplayerentervehicle"

e a funзгo em "onplayerstatechange"...

mas nгo sei como faz


Re: [AJUDA]Simples (pra mim nгo й) - Macintosh - 24.10.2010

Coloca no нnicio do OnPlayerEnterVehicle e deixa o cуdigo 1

pawn Код:
TogglePlayerControllable(playerid, 1); // Deixa mуvel
TogglePlayerControllable(playerid, 0);//Deixa Imуvel



Re: [AJUDA]Simples (pra mim nгo й) - wforest - 24.10.2010

ainda nгo foi cara ... (que saco viu)
vlw por ta tentando me ajudar ....

pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
new string[256];
    GetPlayerName(playerid, sendername, sizeof(sendername));
    format(string, sizeof(string), "* %s Entra no veiculo.", sendername);
    DetectorProx(20.0,playerid,string,ROXO);
    TogglePlayerControllable(playerid, 1); // Deixa mуvel
    {
        for(new i = 0; i < sizeof(CarInfo); i++)
        {
            new newcar = GetPlayerVehicleID(playerid);
            if(newcar == CarInfo[i][ownedvehicle])
            {
                if(CarInfo[i][cOwned]==0)
                {
                    TogglePlayerControllable(playerid, 0);
                    CarOffered[playerid]=1;
                    format(string,sizeof(string),"~w~Carro: %s~n~Preco: ~g~%d~n~~w~/veiculo comprar ,para comprar este veiculo",CarInfo[i][cDescription],CarInfo[i][cValue]);
                    GameTextForPlayer(playerid, string, 5000, 3);
                }
            }
        }
    }



Re: [AJUDA]Simples (pra mim nгo й) - Macintosh - 24.10.2010

Mano vocк pфs a funзгo depois pхe antes

pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
new string[256];
    TogglePlayerControllable(playerid, 1); // Deixa mуvel
    GetPlayerName(playerid, sendername, sizeof(sendername));
    format(string, sizeof(string), "* %s Entra no veiculo.", sendername);
    DetectorProx(20.0,playerid,string,ROXO);
    {
        for(new i = 0; i < sizeof(CarInfo); i++)
        {
            new newcar = GetPlayerVehicleID(playerid);
            if(newcar == CarInfo[i][ownedvehicle])
            {
                if(CarInfo[i][cOwned]==0)
                {
                    TogglePlayerControllable(playerid, 0);
                    CarOffered[playerid]=1;
                    format(string,sizeof(string),"~w~Carro: %s~n~Preco: ~g~%d~n~~w~/veiculo comprar ,para comprar este veiculo",CarInfo[i][cDescription],CarInfo[i][cValue]);
                    GameTextForPlayer(playerid, string, 5000, 3);
                }
            }
        }
    }