[Ajuda] Carro VIP
#1

Bom , quero saber como faзo pra que quando algum player que nгo seja Dono do veнculo VIP entrar no veнculo ele pagar 100R$ ao Dono , ae quando o dono entrar no veнculo apareзa a mensagem de quanto tem de R$ no veнculo .

pawn Код:
if(newstate == 2)
    {
        for(new i = 0; i < sizeof(CarInfo); i++)
        {
            new newcar = GetPlayerVehicleID(playerid);
            new Aluguelbox[256];
            new string[256];
            if(newcar == CarInfo[i][ownedvehicle])
            {
                if(CarInfo[i][cOwned] == 0)
                {
                    Controle(playerid, 0);
                    CarOffered[playerid]=1;
                    //format(string,sizeof(string),"~w~Carro: %s~n~Preco: ~g~%d~n~~w~/veiculo comprar para comprar",CarInfo[i][cDescription],CarInfo[i][cValue]);
                    format(Aluguelbox, sizeof(Aluguelbox),"Carro: %s Preco: %d\nGostaria de compra-lo ?", CarInfo[i][cDescription],CarInfo[i][cValue]);
                    Controle(playerid, 0);
                    ShowPlayerDialog(playerid,  2624, DIALOG_STYLE_MSGBOX, "Deseja comprar este veнculo ?", Aluguelbox, "Sim", "Nгo");
                }
                if(CarInfo[i][cOwned] == 1)
                {
                new playername[MAX_PLAYER_NAME];
                GetPlayerName(playerid, playername, sizeof(playername));
                if(strcmp(playername,CarInfo[i][cOwner],true)==0)
                {
                    format(string,sizeof(string),"Computador de bordo: Bem vindo ao seu Veiculo",CarInfo[i][cGrana]);
                    SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
                    format(string,sizeof(string),"Seu Veнculo VIP possui %d de Grana , /retirargrana.",CarInfo[i][cGrana]);
                    SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
                    Controle(playerid, 1);
                }
                else
                {
                    format(string,sizeof(string),"Vocк pagou 100 por entrar no Veнculo VIP de %s",CarInfo[i][cOwner]);
                    SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
                }
                }
            }
        }
    }
Reply
#2

aparentemente vocк jб tem o cуdigo pronto, basta incrementar o valor da variбvel de dinheiro do veнculo:

pawn Код:
else
{
    CarInfo[i][cGrana] += 100;
    format(string,sizeof(string),"Vocк pagou 100 por entrar no Veнculo VIP de %s",CarInfo[i][cOwner]);
    SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
Reply
#3

Quote:
Originally Posted by Falcon.
Посмотреть сообщение
aparentemente vocк jб tem o cуdigo pronto, basta incrementar o valor da variбvel de dinheiro do veнculo:

pawn Код:
else
{
    CarInfo[i][cGrana] += 100;
    format(string,sizeof(string),"Vocк pagou 100 por entrar no Veнculo VIP de %s",CarInfo[i][cOwner]);
    SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
Obrigado Falcon , funcionou perfeitamente ! + Rep .

Se nгo for pedir muito , pode ajudar nesse outro tуpico ?
https://sampforum.blast.hk/showthread.php?tid=434994
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)