SA-MP Forums

Go Back   SA-MP Forums > Non-English > Languages > Português/Portuguese

Reply
 
Thread Tools Display Modes
Old 17/06/2014, 06:19 PM   #1
LucioRokcFeller
Little Clucker
 
Join Date: Jan 2013
Posts: 24
Reputation: 0
Default Carros de Aluguel

O que acontece meu server estava com um sistema de carros que normalmente da bugs quando se pega um GameMode da internet, o que eu estou fazendo, peguei um GM na internet e estou tentando aprimorar meus conhecidos e tentando modificar ele o máximo possível, e agora to precisando de uma ajuda.
Vamos la o GM que peguei o sistema de carros dele e este.
pawn Code:
public IsAGOVCar(carid)//Carros Governo
{
    if((carid >= 357) && (carid <= 362) || (carid >= 399) && (carid <= 400) || (carid >= 369) && (carid <= 370) || (carid == 479))
    {
        return 1;
    }
    return 0;
}

Agora coloquei para esse Sistema

pawn Code:
new GOV[9];

//|========================================[CARROS CARROS GOVERNO]==================================|
    GOV[0] = AddStaticVehicleEx(409,1532.1926,-1845.8784,13.3430,180.0010,1,1,99999*RESPAWN_TIME); // limosine governo 1 [ 356 ]
    GOV[1] = AddStaticVehicleEx(560,1526.6672,-1826.5502,13.3839,91.1082,1,1,99999*RESPAWN_TIME) ; // Sultan Governo 1 [395]
    GOV[2] = AddStaticVehicleEx(560,1533.7704,-1826.7501,13.3901,90.4799,1,1,99999*RESPAWN_TIME) ; // Sultan Governo 2 [396]
    GOV[3] = AddStaticVehicleEx(560,1535.7477,-1846.8677,13.2390,181.4477,1,1,99999*RESPAWN_TIME); // sultan governo 2 [ 357 ]
    GOV[4] = AddStaticVehicleEx(560,1528.0491,-1846.4027,13.2592,182.8282,1,1,99999*RESPAWN_TIME); // sultan governo 3 [ 358 ]
    GOV[5] = AddStaticVehicleEx(522,1520.3971,-1848.8979,13.1106,182.5410,1,1,99999*RESPAWN_TIME); // moto governo 1 [ 359 ]
    GOV[6] = AddStaticVehicleEx(522,1521.8660,-1848.7748,13.1123,178.7587,1,1,99999*RESPAWN_TIME); // moto governo 2 [ 360 ]
    GOV[7] = AddStaticVehicleEx(522,1523.3265,-1848.7078,13.1173,180.0277,1,1,99999*RESPAWN_TIME); // moto governo [ 361 ]
    GOV[8] = AddStaticVehicleEx(487,1505.1627,-1840.7588,13.7243,88.2486,1,1,99999*RESPAWN_TIME); // Heli Governo    [516]

public IsAGOVCar(carid)//Carros Governo
{
    for(new i=0;i<sizeof(GOV);i++)
    {
        if(carid == GOV[i])
        {
             return 1;
        }
    }
    return 0;
}

Então eu deletei todos os carros do GM inclusive o dos alugueis e adicionei os carros do alugueis da mesma forma, mas o problema e que não to achando onde que eu vou definir que os carros do aluguel vão ser aqueles.

Então ai achei isso aqui em uma parte do aluguel de carros e to com duvida se isso for o que define os carros como vou fazer para definir do novo jeito que eu fiz.

pawn Code:
if((newcar >= 305 && newcar <= 324) || (newcar >= 457 && newcar <= 467) || (newcar >= 325 && newcar <= 352) || (newcar >= 559 && newcar <= 562)
        || (newcar >= 379 && newcar <= 391) || (newcar >= 457 && newcar <= 467) || (newcar >= 459 && newcar <= 464) || (newcar >= 417 && newcar <= 422)
        || (newcar >= 375 && newcar <= 376))
         {
            if (HireCar[playerid] != newcar)
            {
                new Aluguelbox[256];
                format(Aluguelbox, sizeof(Aluguelbox),"Este Veiculo pode ser alugado Preço:R$%d\nDeseja Aluga-lo ?", SBizzInfo[1][sbEntranceCost]);
                TogglePlayerControllable(playerid, 0);
                ShowPlayerDialog(playerid,  DIALOG_ALUGAR, DIALOG_STYLE_MSGBOX, "Aluguel de Veiculos", Aluguelbox, "Sim", "Não");
            }
        }

E os carros dos Aluguel estão assim

pawn Code:
new ALUGUEL[48];

//|========================================[CARROS VEICULOS ALUGUEL]==================================|
    ALUGUEL[0] = AddStaticVehicleEx(560,558.3553,-1289.7278,16.9551,0.8050,103,103,99999*RESPAWN_TIME);
    ALUGUEL[1] = AddStaticVehicleEx(560,554.5654,-1289.6489,16.9552,2.4649,103,103,99999*RESPAWN_TIME);
    ALUGUEL[2] = AddStaticVehicleEx(560,550.9343,-1289.6908,16.9546,3.3999,103,103,99999*RESPAWN_TIME);
    ALUGUEL[3] = AddStaticVehicleEx(506,546.8458,-1289.9054,16.9545,4.1478,103,103,99999*RESPAWN_TIME);
    ALUGUEL[4] = AddStaticVehicleEx(506,542.8229,-1290.2216,16.9480,3.6802,103,103,99999*RESPAWN_TIME);
    ALUGUEL[5] = AddStaticVehicleEx(506,538.1052,-1290.2968,16.9493,1.1534,103,103,99999*RESPAWN_TIME);
    ALUGUEL[6] = AddStaticVehicleEx(559,533.5905,-1290.3926,16.9486,2.4711,103,103,99999*RESPAWN_TIME);
    ALUGUEL[7] = AddStaticVehicleEx(559,528.9374,-1290.5078,16.9491,2.5434,103,103,99999*RESPAWN_TIME);
    ALUGUEL[8] = AddStaticVehicleEx(559,524.9777,-1290.4878,16.9490,4.3869,103,103,99999*RESPAWN_TIME);
    ALUGUEL[9] = AddStaticVehicleEx(480,520.7125,-1291.0891,16.9489,5.2022,103,103,99999*RESPAWN_TIME);
    ALUGUEL[10] = AddStaticVehicleEx(480,552.0004,-1263.1455,16.9484,209.2874,103,103,99999*RESPAWN_TIME);
    ALUGUEL[11] = AddStaticVehicleEx(480,548.2775,-1265.9437,16.9494,207.4516,103,103,99999*RESPAWN_TIME);
    ALUGUEL[12] = AddStaticVehicleEx(451,544.0808,-1268.7469,16.9525,209.3285,103,103,99999*RESPAWN_TIME);
    ALUGUEL[13] = AddStaticVehicleEx(451,540.1223,-1271.9517,16.9491,211.3782,103,103,99999*RESPAWN_TIME);
    ALUGUEL[14] = AddStaticVehicleEx(581,567.0040,-1280.6033,16.8134,101.3406,103,103,99999*RESPAWN_TIME);
    ALUGUEL[15] = AddStaticVehicleEx(581,567.1725,-1282.8904,16.8150,98.1773,103,103,99999*RESPAWN_TIME);
    ALUGUEL[16] = AddStaticVehicleEx(581,567.9107,-1285.1788,16.8099,104.7714,103,103,99999*RESPAWN_TIME);
    ALUGUEL[17] = AddStaticVehicleEx(581,568.4707,-1286.9088,16.8207,106.0463,103,103,99999*RESPAWN_TIME);
    ALUGUEL[18] = AddStaticVehicleEx(521,569.0721,-1289.0919,16.8163,109.3813,103,103,99999*RESPAWN_TIME);
    ALUGUEL[19] = AddStaticVehicleEx(521,569.4713,-1291.3688,16.8175,94.5475,103,103,99999*RESPAWN_TIME);
    ALUGUEL[20] = AddStaticVehicleEx(560,2148.0103,-1203.5555,23.6148,270.2270,103,103,99999*RESPAWN_TIME);
    ALUGUEL[21] = AddStaticVehicleEx(560,2147.9868,-1199.1451,23.6263,270.2075,103,103,99999*RESPAWN_TIME);
    ALUGUEL[22] = AddStaticVehicleEx(560,2147.9705,-1194.6024,23.5921,270.2072,103,103,99999*RESPAWN_TIME);
    ALUGUEL[23] = AddStaticVehicleEx(560,2147.9534,-1189.8275,23.6153,270.2242,103,103,99999*RESPAWN_TIME);
    ALUGUEL[24] = AddStaticVehicleEx(506,2147.9351,-1185.1653,23.6157,270.2242,103,103,99999*RESPAWN_TIME);
    ALUGUEL[25] = AddStaticVehicleEx(506,2147.9175,-1180.5959,23.6157,270.2242,103,103,99999*RESPAWN_TIME);
    ALUGUEL[26] = AddStaticVehicleEx(506,2147.8982,-1175.7385,23.6157,270.2242,103,103,99999*RESPAWN_TIME);
    ALUGUEL[27] = AddStaticVehicleEx(559,2147.8792,-1170.7815,23.6157,270.2242,103,103,99999*RESPAWN_TIME);
    ALUGUEL[28] = AddStaticVehicleEx(559,2147.8623,-1166.5084,23.6157,270.2242,103,103,99999*RESPAWN_TIME);
    ALUGUEL[29] = AddStaticVehicleEx(480,2147.8442,-1161.8684,23.6157,270.2242,103,103,99999*RESPAWN_TIME);
    ALUGUEL[30] = AddStaticVehicleEx(480,2147.8279,-1157.7185,23.6250,270.2243,103,103,99999*RESPAWN_TIME);
    ALUGUEL[31] = AddStaticVehicleEx(451,2147.8103,-1153.2000,23.6530,270.2248,103,103,99999*RESPAWN_TIME);
    ALUGUEL[32] = AddStaticVehicleEx(451,2147.7925,-1148.4026,24.1996,269.9953,103,103,99999*RESPAWN_TIME);
    ALUGUEL[33] = AddStaticVehicleEx(562,2147.7927,-1143.9299,24.6300,269.9059,103,103,99999*RESPAWN_TIME);
    ALUGUEL[34] = AddStaticVehicleEx(562,2147.8035,-1138.5513,25.2669,269.9054,103,103,99999*RESPAWN_TIME);
    ALUGUEL[35] = AddStaticVehicleEx(562,2148.4338,-1133.9785,25.3300,267.5980,103,103,99999*RESPAWN_TIME);
    ALUGUEL[36] = AddStaticVehicleEx(581,2162.7617,-1143.8843,24.4031,94.8846,103,103,99999*RESPAWN_TIME);
    ALUGUEL[37] = AddStaticVehicleEx(581,2163.1655,-1148.4584,23.9399,94.9034,103,103,99999*RESPAWN_TIME);
    ALUGUEL[38] = AddStaticVehicleEx(581,2162.3552,-1153.0013,23.4654,95.1561,103,103,99999*RESPAWN_TIME);
    ALUGUEL[39] = AddStaticVehicleEx(581,2162.4158,-1157.6852,23.4134,87.8344,103,103,99999*RESPAWN_TIME);
    ALUGUEL[40] = AddStaticVehicleEx(463,2162.2075,-1163.1984,23.3819,87.8398,103,103,99999*RESPAWN_TIME);
    ALUGUEL[41] = AddStaticVehicleEx(463,2162.0244,-1168.0548,23.3806,87.8399,103,103,99999*RESPAWN_TIME);
    ALUGUEL[42] = AddStaticVehicleEx(463,2161.8486,-1172.7130,23.3793,87.8401,103,103,99999*RESPAWN_TIME);
    ALUGUEL[43] = AddStaticVehicleEx(522,2161.6694,-1177.4738,23.3791,87.8403,103,103,99999*RESPAWN_TIME);
    ALUGUEL[44] = AddStaticVehicleEx(522,2161.4736,-1182.6678,23.3799,87.8402,103,103,99999*RESPAWN_TIME);
    ALUGUEL[45] = AddStaticVehicleEx(581,2161.2922,-1187.4727,23.3810,87.8400,103,103,99999*RESPAWN_TIME);
    ALUGUEL[46] = AddStaticVehicleEx(468,2161.1135,-1192.2057,23.3822,87.8398,103,103,99999*RESPAWN_TIME);
    ALUGUEL[47] = AddStaticVehicleEx(468,2161.8564,-1196.8351,23.4496,87.4995,103,103,99999*RESPAWN_TIME);
LucioRokcFeller is offline   Reply With Quote
Old 17/06/2014, 10:34 PM   #2
LucioRokcFeller
Little Clucker
 
Join Date: Jan 2013
Posts: 24
Reputation: 0
Default Re: Carros de Aluguel

Ninguem Vai ajudar não?
LucioRokcFeller is offline   Reply With Quote
Old 17/06/2014, 10:48 PM   #3
MultiKill
High-roller
 
Join Date: Apr 2014
Posts: 1,614
Reputation: 85
Default Re: Carros de Aluguel

Não entendi direito o que você quer. Explique melhor.
MultiKill is offline   Reply With Quote
Old 17/06/2014, 10:57 PM   #4
LucioRokcFeller
Little Clucker
 
Join Date: Jan 2013
Posts: 24
Reputation: 0
Default Re: Carros de Aluguel

Eu refiz o sistema de carros do GameMode...Consegui colocar todos os carros de volta, exceto os carros dos alugueis, e onde esta:
pawn Code:
if((newcar >= 305 && newcar <= 324) || (newcar >= 457 && newcar <= 467) || (newcar >= 325 && newcar <= 352) || (newcar >= 559 && newcar <= 562)
        || (newcar >= 379 && newcar <= 391) || (newcar >= 457 && newcar <= 467) || (newcar >= 459 && newcar <= 464) || (newcar >= 417 && newcar <= 422)
        || (newcar >= 375 && newcar <= 376))
         {
            if (HireCar[playerid] != newcar)
            {
                new Aluguelbox[256];
                format(Aluguelbox, sizeof(Aluguelbox),"Este Veiculo pode ser alugado Preço:R$%d\nDeseja Aluga-lo ?", SBizzInfo[1][sbEntranceCost]);
                TogglePlayerControllable(playerid, 0);
                ShowPlayerDialog(playerid,  DIALOG_ALUGAR, DIALOG_STYLE_MSGBOX, "Aluguel de Veiculos", Aluguelbox, "Sim", "Não");
            }
        }

Define os carros que são dos alugueis, ate ai beleza mas não estou conseguindo arrumar uma forma de definir eles da nova forma que organizei os carros no GM sendo que os carros dos alugueis depois de reorganizados ficaram assim:

pawn Code:
new ALUGUEL[48];

//|========================================[CARROS VEICULOS ALUGUEL]==================================|
    ALUGUEL[0] = AddStaticVehicleEx(560,558.3553,-1289.7278,16.9551,0.8050,103,103,99999*RESPAWN_TIME);
    ALUGUEL[1] = AddStaticVehicleEx(560,554.5654,-1289.6489,16.9552,2.4649,103,103,99999*RESPAWN_TIME);
    ALUGUEL[2] = AddStaticVehicleEx(560,550.9343,-1289.6908,16.9546,3.3999,103,103,99999*RESPAWN_TIME);
    ALUGUEL[3] = AddStaticVehicleEx(506,546.8458,-1289.9054,16.9545,4.1478,103,103,99999*RESPAWN_TIME);
    ALUGUEL[4] = AddStaticVehicleEx(506,542.8229,-1290.2216,16.9480,3.6802,103,103,99999*RESPAWN_TIME);
    ALUGUEL[5] = AddStaticVehicleEx(506,538.1052,-1290.2968,16.9493,1.1534,103,103,99999*RESPAWN_TIME);
    ALUGUEL[6] = AddStaticVehicleEx(559,533.5905,-1290.3926,16.9486,2.4711,103,103,99999*RESPAWN_TIME);
    ALUGUEL[7] = AddStaticVehicleEx(559,528.9374,-1290.5078,16.9491,2.5434,103,103,99999*RESPAWN_TIME);
    ALUGUEL[8] = AddStaticVehicleEx(559,524.9777,-1290.4878,16.9490,4.3869,103,103,99999*RESPAWN_TIME);
    ALUGUEL[9] = AddStaticVehicleEx(480,520.7125,-1291.0891,16.9489,5.2022,103,103,99999*RESPAWN_TIME);
    ALUGUEL[10] = AddStaticVehicleEx(480,552.0004,-1263.1455,16.9484,209.2874,103,103,99999*RESPAWN_TIME);
    ALUGUEL[11] = AddStaticVehicleEx(480,548.2775,-1265.9437,16.9494,207.4516,103,103,99999*RESPAWN_TIME);
    ALUGUEL[12] = AddStaticVehicleEx(451,544.0808,-1268.7469,16.9525,209.3285,103,103,99999*RESPAWN_TIME);
    ALUGUEL[13] = AddStaticVehicleEx(451,540.1223,-1271.9517,16.9491,211.3782,103,103,99999*RESPAWN_TIME);
    ALUGUEL[14] = AddStaticVehicleEx(581,567.0040,-1280.6033,16.8134,101.3406,103,103,99999*RESPAWN_TIME);
    ALUGUEL[15] = AddStaticVehicleEx(581,567.1725,-1282.8904,16.8150,98.1773,103,103,99999*RESPAWN_TIME);
    ALUGUEL[16] = AddStaticVehicleEx(581,567.9107,-1285.1788,16.8099,104.7714,103,103,99999*RESPAWN_TIME);
    ALUGUEL[17] = AddStaticVehicleEx(581,568.4707,-1286.9088,16.8207,106.0463,103,103,99999*RESPAWN_TIME);
    ALUGUEL[18] = AddStaticVehicleEx(521,569.0721,-1289.0919,16.8163,109.3813,103,103,99999*RESPAWN_TIME);
    ALUGUEL[19] = AddStaticVehicleEx(521,569.4713,-1291.3688,16.8175,94.5475,103,103,99999*RESPAWN_TIME);
    ALUGUEL[20] = AddStaticVehicleEx(560,2148.0103,-1203.5555,23.6148,270.2270,103,103,99999*RESPAWN_TIME);
    ALUGUEL[21] = AddStaticVehicleEx(560,2147.9868,-1199.1451,23.6263,270.2075,103,103,99999*RESPAWN_TIME);
    ALUGUEL[22] = AddStaticVehicleEx(560,2147.9705,-1194.6024,23.5921,270.2072,103,103,99999*RESPAWN_TIME);
    ALUGUEL[23] = AddStaticVehicleEx(560,2147.9534,-1189.8275,23.6153,270.2242,103,103,99999*RESPAWN_TIME);
    ALUGUEL[24] = AddStaticVehicleEx(506,2147.9351,-1185.1653,23.6157,270.2242,103,103,99999*RESPAWN_TIME);
    ALUGUEL[25] = AddStaticVehicleEx(506,2147.9175,-1180.5959,23.6157,270.2242,103,103,99999*RESPAWN_TIME);
    ALUGUEL[26] = AddStaticVehicleEx(506,2147.8982,-1175.7385,23.6157,270.2242,103,103,99999*RESPAWN_TIME);
    ALUGUEL[27] = AddStaticVehicleEx(559,2147.8792,-1170.7815,23.6157,270.2242,103,103,99999*RESPAWN_TIME);
    ALUGUEL[28] = AddStaticVehicleEx(559,2147.8623,-1166.5084,23.6157,270.2242,103,103,99999*RESPAWN_TIME);
    ALUGUEL[29] = AddStaticVehicleEx(480,2147.8442,-1161.8684,23.6157,270.2242,103,103,99999*RESPAWN_TIME);
    ALUGUEL[30] = AddStaticVehicleEx(480,2147.8279,-1157.7185,23.6250,270.2243,103,103,99999*RESPAWN_TIME);
    ALUGUEL[31] = AddStaticVehicleEx(451,2147.8103,-1153.2000,23.6530,270.2248,103,103,99999*RESPAWN_TIME);
    ALUGUEL[32] = AddStaticVehicleEx(451,2147.7925,-1148.4026,24.1996,269.9953,103,103,99999*RESPAWN_TIME);
    ALUGUEL[33] = AddStaticVehicleEx(562,2147.7927,-1143.9299,24.6300,269.9059,103,103,99999*RESPAWN_TIME);
    ALUGUEL[34] = AddStaticVehicleEx(562,2147.8035,-1138.5513,25.2669,269.9054,103,103,99999*RESPAWN_TIME);
    ALUGUEL[35] = AddStaticVehicleEx(562,2148.4338,-1133.9785,25.3300,267.5980,103,103,99999*RESPAWN_TIME);
    ALUGUEL[36] = AddStaticVehicleEx(581,2162.7617,-1143.8843,24.4031,94.8846,103,103,99999*RESPAWN_TIME);
    ALUGUEL[37] = AddStaticVehicleEx(581,2163.1655,-1148.4584,23.9399,94.9034,103,103,99999*RESPAWN_TIME);
    ALUGUEL[38] = AddStaticVehicleEx(581,2162.3552,-1153.0013,23.4654,95.1561,103,103,99999*RESPAWN_TIME);
    ALUGUEL[39] = AddStaticVehicleEx(581,2162.4158,-1157.6852,23.4134,87.8344,103,103,99999*RESPAWN_TIME);
    ALUGUEL[40] = AddStaticVehicleEx(463,2162.2075,-1163.1984,23.3819,87.8398,103,103,99999*RESPAWN_TIME);
    ALUGUEL[41] = AddStaticVehicleEx(463,2162.0244,-1168.0548,23.3806,87.8399,103,103,99999*RESPAWN_TIME);
    ALUGUEL[42] = AddStaticVehicleEx(463,2161.8486,-1172.7130,23.3793,87.8401,103,103,99999*RESPAWN_TIME);
    ALUGUEL[43] = AddStaticVehicleEx(522,2161.6694,-1177.4738,23.3791,87.8403,103,103,99999*RESPAWN_TIME);
    ALUGUEL[44] = AddStaticVehicleEx(522,2161.4736,-1182.6678,23.3799,87.8402,103,103,99999*RESPAWN_TIME);
    ALUGUEL[45] = AddStaticVehicleEx(581,2161.2922,-1187.4727,23.3810,87.8400,103,103,99999*RESPAWN_TIME);
    ALUGUEL[46] = AddStaticVehicleEx(468,2161.1135,-1192.2057,23.3822,87.8398,103,103,99999*RESPAWN_TIME);
    ALUGUEL[47] = AddStaticVehicleEx(468,2161.8564,-1196.8351,23.4496,87.4995,103,103,99999*RESPAWN_TIME);
LucioRokcFeller is offline   Reply With Quote
Old 17/06/2014, 11:02 PM   #5
MultiKill
High-roller
 
Join Date: Apr 2014
Posts: 1,614
Reputation: 85
Default Re: Carros de Aluguel

Se eu entendi:
Você não está conseguindo identificar se o carro é de aluguel.
pawn Code:
for(new cars=0; cars<47; cars++)
{
    if(GetPlayerVehicleID(playerid) == ALUGUEL[cars])
    {
        //caso o carro for alugado.
    }
}
MultiKill is offline   Reply With Quote
Old 17/06/2014, 11:09 PM   #6
LucioRokcFeller
Little Clucker
 
Join Date: Jan 2013
Posts: 24
Reputation: 0
Default Re: Carros de Aluguel

Acho que nao seria facil assim... deixa eu postar o comando enteiro pq eu to achando que vo bugar as coisas aqui, olha isso tem 2 coisas não to sabendo qual e a dos carros de aluguel
Tem isso:
pawn Code:
if(strcmp(cmd, "/alugarcarro", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if((GetPlayerVehicleID(playerid) >= 325 && GetPlayerVehicleID(playerid) <= 352) || (GetPlayerVehicleID(playerid) >= 559 && GetPlayerVehicleID(playerid) <= 562))
            {
                new hirefee = HireCost(GetPlayerVehicleID(playerid));
                if (GetPlayerMoney (playerid) <  SBizzInfo[1][sbEntranceCost])
                {
                    SendClientMessage(playerid, COLOR_GRAD2, "Você não tem esse dinheiro !");
                    return 1;
                }
                if(HireCar[playerid] > 0)
                {
                    ShowPlayerDialog(playerid, 5024, DIALOG_STYLE_MSGBOX, "Desalugar", "Você já tem um Veiculo alugado.\nDeseja desalugar-lo?", "Sim", "Não");
                    return 1;
                }
                for(new i=0; i<MAX_PLAYERS; i++)
                {
                    if(HireCar[i] == GetPlayerVehicleID(playerid))
                    {
                        SendClientMessage(playerid, COLOR_GREY, "Alguem já alugou esse veiculo !");
                        TogglePlayerControllable(playerid, 1);
                        RemovePlayerFromVehicleEx(playerid);
                        return 1;
                    }
                }
                GivePlayerMoney(playerid,-SBizzInfo[1][sbEntranceCost]);
                SBizzInfo[1][sbTill] += SBizzInfo[1][sbEntranceCost];
                ExtortionSBiz(1, SBizzInfo[1][sbEntranceCost]);
                HireCar[playerid] = GetPlayerVehicleID(playerid);
                OnPropUpdate();
                PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
                format(string, sizeof(string), "~w~Voce pode ~r~/desalugarcarro~n~~g~ou /trancar ~w~ para trancar o carro.",hirefee);
                TogglePlayerControllable(playerid, 1);
                GameTextForPlayer(playerid, string, 5000, 3);
                return 1;
            }
            else if((GetPlayerVehicleID(playerid) >= 305 && GetPlayerVehicleID(playerid) <= 324) || (GetPlayerVehicleID(playerid) >= 457 && GetPlayerVehicleID(playerid) <= 467))
            {
                new hirefee = HireCost(GetPlayerVehicleID(playerid));
                if (GetPlayerMoney (playerid) <  SBizzInfo[20][sbEntranceCost])
                {
                    SendClientMessage(playerid, COLOR_GRAD2, "Você não tem esse dinheiro !");
                    RemovePlayerFromVehicle(playerid);
                    return 1;
                }
                if(HireCar[playerid] > 0)
                {
                    ShowPlayerDialog(playerid, 5024, DIALOG_STYLE_MSGBOX, "Desalugar", "Você já tem um Veiculo alugado.\nDeseja desalugar-lo?", "Sim", "Não");
                    return 1;
                }
                for(new i=0; i<MAX_PLAYERS; i++)
                {
                    if(HireCar[i] == GetPlayerVehicleID(playerid))
                    {
                        SendClientMessage(playerid, COLOR_GREY, "Alguem já alugou esse veiculo !");
                        TogglePlayerControllable(playerid, 1);
                        RemovePlayerFromVehicleEx(playerid);
                        return 1;
                    }
                }
                GivePlayerMoney(playerid,-SBizzInfo[19][sbEntranceCost]);
                SBizzInfo[19][sbTill] += SBizzInfo[19][sbEntranceCost];
                ExtortionSBiz(19, SBizzInfo[19][sbEntranceCost]);
                HireCar[playerid] = GetPlayerVehicleID(playerid);
                OnPropUpdate();
                PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
                format(string, sizeof(string), "~w~Voce pode ~r~/desalugarcarro~n~~g~ou /trancar ~w~ para trancar o carro.",hirefee);
                TogglePlayerControllable(playerid, 1);
                GameTextForPlayer(playerid, string, 5000, 3);
                return 1;
            }
            else if((GetPlayerVehicleID(playerid) >= 379 && GetPlayerVehicleID(playerid) <= 391) || (GetPlayerVehicleID(playerid) >= 457 && GetPlayerVehicleID(playerid) <= 467))
            {
                new hirefee = HireCost(GetPlayerVehicleID(playerid));
                if (GetPlayerMoney (playerid) <  SBizzInfo[20][sbEntranceCost])
                {
                    SendClientMessage(playerid, COLOR_GRAD2, "Você não tem esse dinheiro !");
                    return 1;
                }
                if(HireCar[playerid] > 0)
                {
                    ShowPlayerDialog(playerid, 5024, DIALOG_STYLE_MSGBOX, "Desalugar", "Você já tem um Veiculo alugado.\nDeseja desalugar-lo?", "Sim", "Não");
                    return 1;
                }
                for(new i=0; i<MAX_PLAYERS; i++)
                {
                    if(HireCar[i] == GetPlayerVehicleID(playerid))
                    {
                        SendClientMessage(playerid, COLOR_GREY, "Alguem já alugou esse veiculo !");
                        TogglePlayerControllable(playerid, 1);
                        RemovePlayerFromVehicleEx(playerid);
                        return 1;
                    }
                }
                GivePlayerMoney(playerid,-SBizzInfo[20][sbEntranceCost]);
                SBizzInfo[20][sbTill] += SBizzInfo[20][sbEntranceCost];
                ExtortionSBiz(20, SBizzInfo[20][sbEntranceCost]);
                HireCar[playerid] = GetPlayerVehicleID(playerid);
                OnPropUpdate();
                PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
                format(string, sizeof(string), "~w~Voce pode ~r~/desalugarcarro~n~~g~ou /trancar ~w~ para trancar o carro.",hirefee);
                TogglePlayerControllable(playerid, 1);
                GameTextForPlayer(playerid, string, 5000, 3);
                return 1;
            }
                else if((GetPlayerVehicleID(playerid) >= 459 && GetPlayerVehicleID(playerid) <= 464) || (GetPlayerVehicleID(playerid) >= 417 && GetPlayerVehicleID(playerid) <= 422) || (GetPlayerVehicleID(playerid) >= 375 && GetPlayerVehicleID(playerid) <= 376))
            {
                new hirefee = HireCost(GetPlayerVehicleID(playerid));
                if (GetPlayerMoney (playerid) <  SBizzInfo[20][sbEntranceCost])
                {
                    SendClientMessage(playerid, COLOR_GRAD2, "Você não tem esse dinheiro !");
                    RemovePlayerFromVehicle(playerid);
                    return 1;
                }
                if(HireCar[playerid] > 0)
                {
                    ShowPlayerDialog(playerid, 5024, DIALOG_STYLE_MSGBOX, "Desalugar", "Você já tem um Veiculo alugado.\nDeseja desalugar-lo?", "Sim", "Não");
                    return 1;
                }
                for(new i=0; i<MAX_PLAYERS; i++)
                {
                    if(HireCar[i] == GetPlayerVehicleID(playerid))
                    {
                        SendClientMessage(playerid, COLOR_GREY, "Alguem já alugou esse veiculo !");
                        TogglePlayerControllable(playerid, 1);
                        RemovePlayerFromVehicleEx(playerid);
                        return 1;
                    }
                }
                GivePlayerMoney(playerid,-SBizzInfo[20][sbEntranceCost]);
                SBizzInfo[20][sbTill] += SBizzInfo[20][sbEntranceCost];
                ExtortionSBiz(20, SBizzInfo[20][sbEntranceCost]);
                HireCar[playerid] = GetPlayerVehicleID(playerid);
                OnPropUpdate();
                PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
                format(string, sizeof(string), "~w~Voce pode ~r~/desalugarcarro~n~~g~ou /trancar ~w~ para trancar o carro.",hirefee);
                TogglePlayerControllable(playerid, 1);
                GameTextForPlayer(playerid, string, 5000, 3);
                return 1;
            }
        }
        return 1;
    }

E tem isso

pawn Code:
if((newcar >= 305 && newcar <= 324) || (newcar >= 457 && newcar <= 467) || (newcar >= 325 && newcar <= 352) || (newcar >= 559 && newcar <= 562)
        || (newcar >= 379 && newcar <= 391) || (newcar >= 457 && newcar <= 467) || (newcar >= 459 && newcar <= 464) || (newcar >= 417 && newcar <= 422)
        || (newcar >= 375 && newcar <= 376))
         {
            if (HireCar[playerid] != newcar)
            {
                new Aluguelbox[256];
                format(Aluguelbox, sizeof(Aluguelbox),"Este Veiculo pode ser alugado Preço:R$%d\nDeseja Aluga-lo ?", SBizzInfo[1][sbEntranceCost]);
                TogglePlayerControllable(playerid, 0);
                ShowPlayerDialog(playerid,  DIALOG_ALUGAR, DIALOG_STYLE_MSGBOX, "Aluguel de Veiculos", Aluguelbox, "Sim", "Não");
            }
        }
        else if(IsABikeCar(newcar))
        {
            SendClientMessage(playerid, 0x33FF00FF, "{43CD80}****** {54FF9F}veiculo de Novatos {43CD80}******");
            SendClientMessage(playerid, 0x33FF00FF, "{FF8247}Vá ate a prefeitura para escolher um emprego, use {00FF00}/gps{FF8247}.");
            SendClientMessage(playerid, 0x33FF00FF, "{FF8247}Caso precise de uma ajuda chame um Helper, basta utilizar {00FF00}/duvida{FF8247}.");
        }
LucioRokcFeller is offline   Reply With Quote
Old 17/06/2014, 11:50 PM   #7
LucioRokcFeller
Little Clucker
 
Join Date: Jan 2013
Posts: 24
Reputation: 0
Default Re: Carros de Aluguel

Alguem ajuda ae por favor?
LucioRokcFeller is offline   Reply With Quote
Old 18/06/2014, 12:07 AM   #8
DartakousLien
High-roller
 
DartakousLien's Avatar
 
Join Date: Jan 2010
Location: Portugal
Posts: 1,224
Reputation: 87
Default Re: Carros de Aluguel

cara, vou só dar um exemplo, já que você quer aprimorar daí você tenta fazer

pawn Code:
#define MAX_VEICULOS_ALUGUEL 7
//
//
#define EVeiculoAluguel(veiculoid) \
        (veiculoid >= veiculos_aluguel[0] && veiculoid <= veiculos_aluguel[MAX_VEICULOS_ALUGUEL-1])
//
//
new veiculos_aluguel[MAX_VEICULOS_ALUGUEL];
//
//
veiculos_aluguel[0] = AddStaticVehicleEx(.....
veiculos_aluguel[1] = AddStaticVehicleEx(.....
veiculos_aluguel[2] = AddStaticVehicleEx(.....
veiculos_aluguel[3] = AddStaticVehicleEx(.....
veiculos_aluguel[4] = AddStaticVehicleEx(.....
veiculos_aluguel[5] = AddStaticVehicleEx(.....
veiculos_aluguel[6] = AddStaticVehicleEx(.....
//
//
//depois lá no if só tem de usar
//
if(EVeiculoAluguel(GetPlayerVehicleID(playerid)))


pronto, para adicionar é so alterar o numero em MAX_VEICULOS_ALUGUEL e adicionar mais

veiculos_aluguel[7] = AddStaticVehicleEx(.....
veiculos_aluguel[8] = AddStaticVehicleEx(.....


quantos voce quiser
__________________
Github : Procurando interessados em participar em projetos comigo.
Visite também o meu portfólio
DartakousLien is offline   Reply With Quote
Old 18/06/2014, 12:22 AM   #9
LucioRokcFeller
Little Clucker
 
Join Date: Jan 2013
Posts: 24
Reputation: 0
Default Re: Carros de Aluguel

cara você não entendeu isso ai já está adicionado, tanto que eu postei la em cima ALUGUEL[0].....
O que eu não to conseguindo pensar e como vou substituir isso:

pawn Code:
if((newcar >= 305 && newcar <= 324) || (newcar >= 457 && newcar <= 467) || (newcar >= 325 && newcar <= 352) || (newcar >= 559 && newcar <= 562)
        || (newcar >= 379 && newcar <= 391) || (newcar >= 457 && newcar <= 467) || (newcar >= 459 && newcar <= 464) || (newcar >= 417 && newcar <= 422)
        || (newcar >= 375 && newcar <= 376))
         {
            if (HireCar[playerid] != newcar)
            {
                new Aluguelbox[256];
                format(Aluguelbox, sizeof(Aluguelbox),"Este Veiculo pode ser alugado Preço:R$%d\nDeseja Aluga-lo ?", SBizzInfo[1][sbEntranceCost]);
                TogglePlayerControllable(playerid, 0);
                ShowPlayerDialog(playerid,  DIALOG_ALUGAR, DIALOG_STYLE_MSGBOX, "Aluguel de Veiculos", Aluguelbox, "Sim", "Não");
            }
        }
        else if(IsABikeCar(newcar))
        {
            SendClientMessage(playerid, 0x33FF00FF, "{43CD80}****** {54FF9F}veiculo de Novatos {43CD80}******");
            SendClientMessage(playerid, 0x33FF00FF, "{FF8247}Vá ate a prefeitura para escolher um emprego, use {00FF00}/gps{FF8247}.");
            SendClientMessage(playerid, 0x33FF00FF, "{FF8247}Caso precise de uma ajuda chame um Helper, basta utilizar {00FF00}/duvida{FF8247}.");
        }

Nesse comando esta definido para ser esses carros ai, mas quero que eles fiquem definidos para isso => new ALUGUEL[48];

E não to conseguindo achar uma forma de definir e isso que eu quero.
LucioRokcFeller is offline   Reply With Quote
Old 18/06/2014, 12:25 AM   #10
DartakousLien
High-roller
 
DartakousLien's Avatar
 
Join Date: Jan 2010
Location: Portugal
Posts: 1,224
Reputation: 87
Default Re: Carros de Aluguel

porque você está fazendo uma tremenda confusão! isso são sistemas do tempo do "The 10MB computer" cara, lá bem do inicio mesmo... esquece isso aí

por exemplo, isso aí (newcar >= 305 && newcar <= 324) é para veículos com id entre 305 e 324, mas aí se você quiser adicionar mais um a seguir ao 304, então passará a ser o 305 e você terá de mudar isso para (newcar >= 306 && newcar <= 325)

esquece esses sistemas cara! faz de novo
__________________
Github : Procurando interessados em participar em projetos comigo.
Visite também o meu portfólio
DartakousLien is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Ajuda] aluguel de carros AssasinoLM Português/Portuguese 3 05/11/2013 11:25 PM
[Ajuda] Aluguel de Carros FPB_Lipos Português/Portuguese 3 10/12/2012 02:47 PM
[Ajuda]Aluguel de carros Tiu_DaColombia Português/Portuguese 5 18/04/2012 06:36 PM
[Ajuda] Com Carros de aluguel Renancito10 Português/Portuguese 12 28/07/2011 12:09 AM
[Release/Help] Sisteminha de aluguel de carros victor_h666 Português/Portuguese 4 31/12/2010 12:52 PM


All times are GMT. The time now is 12:28 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.