[Ajuda] Carros de Aluguel
#1

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 Код:
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 Код:
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 Код:
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 Код:
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);
Reply
#2

Ninguem Vai ajudar nгo?
Reply
#3

Nгo entendi direito o que vocк quer. Explique melhor.
Reply
#4

Eu refiz o sistema de carros do GameMode...Consegui colocar todos os carros de volta, exceto os carros dos alugueis, e onde esta:
pawn Код:
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 Код:
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);
Reply
#5

Se eu entendi:
Vocк nгo estб conseguindo identificar se o carro й de aluguel.
pawn Код:
for(new cars=0; cars<47; cars++)
{
    if(GetPlayerVehicleID(playerid) == ALUGUEL[cars])
    {
        //caso o carro for alugado.
    }
}
Reply
#6

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 Код:
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 Код:
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}.");
        }
Reply
#7

Alguem ajuda ae por favor?
Reply
#8

cara, vou sу dar um exemplo, jб que vocк quer aprimorar daн vocк tenta fazer

pawn Код:
#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
Reply
#9

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 Код:
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.
Reply
#10

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
Reply


Forum Jump:


Users browsing this thread: 5 Guest(s)