[Ajuda] veiculo publico nгo esta cobrando money
#1

Bom eu tava fazendo um sistema de veiculos publicos onde se os jogadores usar eles paga uma TAXA X
Код HTML:
new VRC[11]; 
public OnPlayerConnect(playerid)
{
    for(new rcv; rcv < MAX_VEHICLES; rcv++)
    {
        if(rcv >= VRC[0] && rcv <= VRC[sizeof(VRC)-1])
        {
			format(STRX, sizeof(STRX), "{7CFC00}%s\n{FFFFFF}•• Veнculo Publico ••", veehName[GetVehicleModel(rcv)-400]);
            new Text3D:d3d = Create3DTextLabel(STRX, 0xFFFFFFFF, 0.0, 0.0, 0.0, 10.0, 0);
            Attach3DTextLabelToVehicle(d3d, rcv, 0.0, 0.0, 0.0);
            GivePlayerGrana (playerid, -400);

        }
    }
    return 1;
}
pois eu tentei de 2 formas e nгo deu

GivePlayerGrana (playerid, -400);
(rcv)-400]);
Reply
#2

Код:
new VRC[11]; 
public OnPlayerConnect(playerid)
{
for(new rcv; rcv < MAX_VEHICLES; rcv++)
{
if(rcv >= VRC[0] && rcv <= VRC[sizeof(VRC)-1])
{
format(STRX, sizeof(STRX), "{7CFC00}%s\n{FFFFFF}•• Veнculo Publico ••", veehName[GetVehicleModel(rcv)-400]);
new Text3D:d3d = Create3DTextLabel(STRX, 0xFFFFFFFF, 0.0, 0.0, 0.0, 10.0, 0);
Attach3DTextLabelToVehicle(d3d, rcv, 0.0, 0.0, 0.0);
GivePlayerGrana( playerid, -5000 );

}
}
return 1;
}
Reply
#3

alguem?
Reply
#4

Gatгo tб fazendo tudo errado, mostra o cуdigo desde o comeзo.

Desde aonde cria os carros pъblicos para nos vermos as variбveis.
Reply
#5

PHP код:
#include <a_samp>

new VehPublico[3];

new 
VehicleNames[][] =
{
    
"Landstalker""Bravura""Buffalo""Linerunner""Perrenial""Sentinel",
    
"Dumper""Firetruck""Trashmaster""Stretch""Manana""Infernus",
    
"Voodoo""Pony""Mule""Cheetah""Ambulance""Leviathan""Moonbeam",
    
"Esperanto""Taxi""Washington""Bobcat""Whoopee""BF Injection",
    
"Hunter""Premier""Enforcer""Securicar""Banshee""Predator""Bus",
    
"Rhino""Barracks""Hotknife""Trailer""Previon""Coach""Cabbie",
    
"Stallion""Rumpo""RC Bandit""Romero""Packer""Monster""Admiral",
    
"Squalo""Seasparrow""Pizzaboy""Tram""Trailer""Turismo""Speeder",
    
"Reefer""Tropic""Flatbed""Yankee""Caddy""Solair""Berkley's RC Van",
    
"Skimmer""PCJ-600""Faggio""Freeway""RC Baron""RC Raider""Glendale",
    
"Oceanic","Sanchez""Sparrow""Patriot""Quad""Coastguard""Dinghy",
    
"Hermes""Sabre""Rustler""ZR-350""Walton""Regina""Comet""BMX",
    
"Burrito""Camper""Marquis""Baggage""Dozer""Maverick""News Chopper",
    
"Rancher""FBI Rancher""Virgo""Greenwood""Jetmax""Hotring""Sandking",
    
"Blista Compact""Police Maverick""Boxville""Benson""Mesa""RC Goblin",
    
"Hotring Racer A""Hotring Racer B""Bloodring Banger""Rancher""Super GT",
    
"Elegant""Journey""Bike""Mountain Bike""Beagle""Cropduster""Stunt",
     
"Tanker""Roadtrain""Nebula""Majestic""Buccaneer""Shamal""Hydra",
     
"FCR-900""NRG-500""HPV1000""Cement Truck""Tow Truck""Fortune",
     
"Cadrona""FBI Truck""Willard""Forklift""Tractor""Combine""Feltzer",
     
"Remington""Slamvan""Blade""Freight""Streak""Vortex""Vincent",
    
"Bullet""Clover""Sadler""Firetruck""Hustler""Intruder""Primo",
    
"Cargobob""Tampa""Sunrise""Merit""Utility""Nevada""Yosemite",
    
"Windsor""Monster""Monster""Uranus""Jester""Sultan""Stratium",
    
"Elegy""Raindance""RC Tiger""Flash""Tahoma""Savanna""Bandito",
    
"Freight Flat""Streak Carriage""Kart""Mower""Dune""Sweeper",
    
"Broadway""Tornado""AT-400""DFT-30""Huntley""Stafford""BF-400",
    
"News Van""Tug""Trailer""Emperor""Wayfarer""Euros""Hotdog""Club",
    
"Freight Box""Trailer""Andromada""Dodo""RC Cam""Launch""Police Car",
     
"Police Car""Police Car""Police Ranger""Picador""S.W.A.T""Alpha",
     
"Phoenix""Glendale""Sadler""Luggage""Luggage""Stairs""Boxville",
     
"Tiller""Utility Trailer"
};

main()
{
    print(
"\n----------------------------------");
    print(
" Blank Gamemode by your name here");
    print(
"----------------------------------\n");
}

public 
OnGameModeInit()
{
    
VehPublico[0] = CreateVehicle(4110000.0000,0000.0000,0000.0000,0000.0000, -1, -199999);
    
VehPublico[1] = CreateVehicle(4110000.0000,0000.0000,0000.0000,0000.0000, -1, -199999);
    
VehPublico[2] = CreateVehicle(4110000.0000,0000.0000,0000.0000,0000.0000, -1, -199999);
    return 
1;
}

public 
OnPlayerEnterVehicle(playeridvehicleidispassenger)
{
    new 
str[124], Text3D:VehPublicoText3D[MAX_VEHICLES];
    for(new 
iMAX_VEHICLESi++)
    {
        if(
GetPlayerState(playerid) == PLAYER_STATE_DRIVER) {
            if(
GetPlayerVehicleID(playerid) == VehPublico[0] || VehPublico[1] || VehPublico[2]) {
                if(
GetPlayerMoney(playerid) >= 400) {
                    
format(strsizeof(str), "{7CFC00}%s\n{FFFFFF}•• Veнculo Publico ••"VehicleNames[GetVehicleModel(vehicleid)-400]);
                    
VehPublicoText3D[vehicleid] = Create3DTextLabel(str0xFFFFFFFF0.00.00.010.00);
                    
Attach3DTextLabelToVehicle(VehPublicoText3D[vehicleid], GetPlayerVehicleID(playerid), 0.00.00.0);
                    
GivePlayerMoney(playerid, -400);
                } else {
                    
SendClientMessage(playerid, -1"[ ERRO ] {FF0000}Vocк nгo tem dinheiro suficiente para alugar este veнculo pъblico por R$400");
                    
RemovePlayerFromVehicle(playerid);
                }
            }
        }
    }
    return 
1;

Reply
#6

Quote:
Originally Posted by [BOPE]Seu._.Madruga
Посмотреть сообщение
PHP код:
#include <a_samp>
new VehPublico[3];
new 
VehicleNames[][] =
{
    
"Landstalker""Bravura""Buffalo""Linerunner""Perrenial""Sentinel",
    
"Dumper""Firetruck""Trashmaster""Stretch""Manana""Infernus",
    
"Voodoo""Pony""Mule""Cheetah""Ambulance""Leviathan""Moonbeam",
    
"Esperanto""Taxi""Washington""Bobcat""Whoopee""BF Injection",
    
"Hunter""Premier""Enforcer""Securicar""Banshee""Predator""Bus",
    
"Rhino""Barracks""Hotknife""Trailer""Previon""Coach""Cabbie",
    
"Stallion""Rumpo""RC Bandit""Romero""Packer""Monster""Admiral",
    
"Squalo""Seasparrow""Pizzaboy""Tram""Trailer""Turismo""Speeder",
    
"Reefer""Tropic""Flatbed""Yankee""Caddy""Solair""Berkley's RC Van",
    
"Skimmer""PCJ-600""Faggio""Freeway""RC Baron""RC Raider""Glendale",
    
"Oceanic","Sanchez""Sparrow""Patriot""Quad""Coastguard""Dinghy",
    
"Hermes""Sabre""Rustler""ZR-350""Walton""Regina""Comet""BMX",
    
"Burrito""Camper""Marquis""Baggage""Dozer""Maverick""News Chopper",
    
"Rancher""FBI Rancher""Virgo""Greenwood""Jetmax""Hotring""Sandking",
    
"Blista Compact""Police Maverick""Boxville""Benson""Mesa""RC Goblin",
    
"Hotring Racer A""Hotring Racer B""Bloodring Banger""Rancher""Super GT",
    
"Elegant""Journey""Bike""Mountain Bike""Beagle""Cropduster""Stunt",
     
"Tanker""Roadtrain""Nebula""Majestic""Buccaneer""Shamal""Hydra",
     
"FCR-900""NRG-500""HPV1000""Cement Truck""Tow Truck""Fortune",
     
"Cadrona""FBI Truck""Willard""Forklift""Tractor""Combine""Feltzer",
     
"Remington""Slamvan""Blade""Freight""Streak""Vortex""Vincent",
    
"Bullet""Clover""Sadler""Firetruck""Hustler""Intruder""Primo",
    
"Cargobob""Tampa""Sunrise""Merit""Utility""Nevada""Yosemite",
    
"Windsor""Monster""Monster""Uranus""Jester""Sultan""Stratium",
    
"Elegy""Raindance""RC Tiger""Flash""Tahoma""Savanna""Bandito",
    
"Freight Flat""Streak Carriage""Kart""Mower""Dune""Sweeper",
    
"Broadway""Tornado""AT-400""DFT-30""Huntley""Stafford""BF-400",
    
"News Van""Tug""Trailer""Emperor""Wayfarer""Euros""Hotdog""Club",
    
"Freight Box""Trailer""Andromada""Dodo""RC Cam""Launch""Police Car",
     
"Police Car""Police Car""Police Ranger""Picador""S.W.A.T""Alpha",
     
"Phoenix""Glendale""Sadler""Luggage""Luggage""Stairs""Boxville",
     
"Tiller""Utility Trailer"
};
main()
{
    print(
"\n----------------------------------");
    print(
" Blank Gamemode by your name here");
    print(
"----------------------------------\n");
}
public 
OnGameModeInit()
{
    
VehPublico[0] = CreateVehicle(4110000.0000,0000.0000,0000.0000,0000.0000, -1, -199999);
    
VehPublico[1] = CreateVehicle(4110000.0000,0000.0000,0000.0000,0000.0000, -1, -199999);
    
VehPublico[2] = CreateVehicle(4110000.0000,0000.0000,0000.0000,0000.0000, -1, -199999);
    return 
1;
}
public 
OnPlayerEnterVehicle(playeridvehicleidispassenger)
{
    new 
str[124], Text3D:VehPublicoText3D[MAX_VEHICLES];
    for(new 
iMAX_VEHICLESi++)
    {
        if(
GetPlayerState(playerid) == PLAYER_STATE_DRIVER) {
            if(
GetPlayerVehicleID(playerid) == VehPublico[0] || VehPublico[1] || VehPublico[2]) {
                if(
GetPlayerMoney(playerid) >= 400) {
                    
format(strsizeof(str), "{7CFC00}%s\n{FFFFFF}•• Veнculo Publico ••"VehicleNames[GetVehicleModel(vehicleid)-400]);
                    
VehPublicoText3D[vehicleid] = Create3DTextLabel(str0xFFFFFFFF0.00.00.010.00);
                    
Attach3DTextLabelToVehicle(VehPublicoText3D[vehicleid], GetPlayerVehicleID(playerid), 0.00.00.0);
                    
GivePlayerMoney(playerid, -400);
                } else {
                    
SendClientMessage(playerid, -1"[ ERRO ] {FF0000}Vocк nгo tem dinheiro suficiente para alugar este veнculo pъblico por R$400");
                    
RemovePlayerFromVehicle(playerid);
                }
            }
        }
    }
    return 
1;






Obrigado precissa de um sistema parecido muito obrigado
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)