Jump to content
  • 0

Adaugare remorca la camion


Guest Alxxie

Question

Cum fac sa adaug o remorca la camion???Cand zic remorca ma refer la trailere.

Am vazut ca in prograul pawno este AttachTrailerToVehicle....As vrea sa-mi zica cineva cum adaug remorci cu  AttachTrailerToVehicle..Sau sa-mi ziceti o alta varianta inafara de asta.

Link to comment
Share on other sites

16 answers to this question

Recommended Posts

=-" post="20456" timestamp="1255778145"]

AttachTrailerToVehicle(ID remorca, ID camion);

Ex: AttachTrailerToVehicle(450, 403);

Asta o  pun dupa AddStaticVehicle??

Link to comment
Share on other sites

=-" post="20492" timestamp="1255786601"]

Nu. Dupa OnGameModeInit

Pai eu vreau sa pun o remorca la un camion care e pus in GM la AddStaticVehicle.Daca am 10 camioane puse cu AddStaticVehicle cum pun remorca la unele dintre ele????

Link to comment
Share on other sites

=-" post="43071" timestamp="1286827670"]

Ce rost are daca e aceeasi problema?

Da viorel am trecut si la probleme godfather am mai dat si un quote dai degeaba :(

Sa rezolv si eu problema asta s dai close te rog...Am muncit mult la tow car company credema :(

Revin dupa 12 ore cu un quote sa nu se zica ca am facut dublu post bag comanda:

//tractare vehicule
    if ( strcmp ( cmdtext , "/ad", true)==0){

    new Float:pX,Float:pY,Float:pZ;
    GetPlayerPos(playerid,pX,pY,pZ);
    new Float:vX,Float:vY,Float:vZ;
    new Found=0;
    new vid=0;
    while((vid<MAX_VEHICLES)&&(!Found))
    {
    vid++;
    GetVehiclePos(vid,vX,vY,vZ);
    if  ((floatabs(pX-vX)<7.0)&&(floatabs(pY-vY)<7.0)&&(floatabs(pZ-vZ)<7.0)&&(vid!=GetPlayerVehicleID(playerid)))
    {
    Found=1;
    if(IsTrailerAttachedToVehicle(GetPlayerVehicleID(playerid)))
    {
    DetachTrailerFromVehicle(GetPlayerVehicleID(playerid));
    SendClientMessage(playerid,0xFFFF00AA,"Ai deatasat masina");
    }else
    {
    AttachTrailerToVehicle(vid,GetPlayerVehicleID(playerid));
    new string[256];
    format(string,256,"Acum tu tractezi un %s",VehicleName[GetVehicleModel(vid)-400]);
    SendClientMessage(playerid,0xFFFF00AA,string);
    }
    }
    }
    if  (!Found)
    {
    SendClientMessage(playerid,0xFFFF00AA,"Nu am gasit nici un vehicul,mergeti mai aproape de masina.");
    }
    return 1;
}
///////

si imi da aceste erori:

C:\Documents and Settings\Gaby\Desktop\MrIllusion\MrIllusion\gamemodes\eRP.pwn(23716) : warning 219: local variable "string" shadows a variable at a preceding level

C:\Documents and Settings\Gaby\Desktop\MrIllusion\MrIllusion\gamemodes\eRP.pwn(23717) : error 017: undefined symbol "VehicleName"

C:\Documents and Settings\Gaby\Desktop\MrIllusion\MrIllusion\gamemodes\eRP.pwn(23717) : warning 215: expression has no effect

C:\Documents and Settings\Gaby\Desktop\MrIllusion\MrIllusion\gamemodes\eRP.pwn(23717) : error 001: expected token: ";", but found "]"

C:\Documents and Settings\Gaby\Desktop\MrIllusion\MrIllusion\gamemodes\eRP.pwn(23717) : error 029: invalid expression, assumed zero

C:\Documents and Settings\Gaby\Desktop\MrIllusion\MrIllusion\gamemodes\eRP.pwn(23717) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase

4 Errors.

Link to comment
Share on other sites

Da viorel am trecut si la probleme godfather am mai dat si un quote dai degeaba :(

Sa rezolv si eu problema asta s dai close te rog...Am muncit mult la tow car company credema :(

Revin dupa 12 ore cu un quote sa nu se zica ca am facut dublu post bag comanda:

//tractare vehicule
    if ( strcmp ( cmdtext , "/ad", true)==0){

    new Float:pX,Float:pY,Float:pZ;
    GetPlayerPos(playerid,pX,pY,pZ);
    new Float:vX,Float:vY,Float:vZ;
    new Found=0;
    new vid=0;
    while((vid<MAX_VEHICLES)&&(!Found))
    {
    vid++;
    GetVehiclePos(vid,vX,vY,vZ);
    if  ((floatabs(pX-vX)<7.0)&&(floatabs(pY-vY)<7.0)&&(floatabs(pZ-vZ)<7.0)&&(vid!=GetPlayerVehicleID(playerid)))
    {
    Found=1;
    if(IsTrailerAttachedToVehicle(GetPlayerVehicleID(playerid)))
    {
    DetachTrailerFromVehicle(GetPlayerVehicleID(playerid));
    SendClientMessage(playerid,0xFFFF00AA,"Ai deatasat masina");
    }else
    {
    AttachTrailerToVehicle(vid,GetPlayerVehicleID(playerid));
    new string[256];
    format(string,256,"Acum tu tractezi un %s",VehicleName[GetVehicleModel(vid)-400]);
    SendClientMessage(playerid,0xFFFF00AA,string);
    }
    }
    }
    if  (!Found)
    {
    SendClientMessage(playerid,0xFFFF00AA,"Nu am gasit nici un vehicul,mergeti mai aproape de masina.");
    }
    return 1;
}
///////

si imi da aceste erori:

C:\Documents and Settings\Gaby\Desktop\MrIllusion\MrIllusion\gamemodes\eRP.pwn(23716) : warning 219: local variable "string" shadows a variable at a preceding level

C:\Documents and Settings\Gaby\Desktop\MrIllusion\MrIllusion\gamemodes\eRP.pwn(23717) : error 017: undefined symbol "VehicleName"

C:\Documents and Settings\Gaby\Desktop\MrIllusion\MrIllusion\gamemodes\eRP.pwn(23717) : warning 215: expression has no effect

C:\Documents and Settings\Gaby\Desktop\MrIllusion\MrIllusion\gamemodes\eRP.pwn(23717) : error 001: expected token: ";", but found "]"

C:\Documents and Settings\Gaby\Desktop\MrIllusion\MrIllusion\gamemodes\eRP.pwn(23717) : error 029: invalid expression, assumed zero

C:\Documents and Settings\Gaby\Desktop\MrIllusion\MrIllusion\gamemodes\eRP.pwn(23717) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase

4 Errors.

Mai revin cu un quote peste 12 ore si fara ajutor :(

Link to comment
Share on other sites

Adauga asta undeva pe la inceputul scriptului.

new VehicleName[][] =
{
  "Landstalker",
  "Bravura",
  "Buffalo",
  "Linerunner",
  "Pereniel",
  "Sentinel",
  "Dumper",
  "Firetruck",
  "Trashmaster",
  "Stretch",
  "Manana",
  "Infernus",
  "Voodoo",
  "Pony",
  "Mule",
  "Cheetah",
  "Ambulance",
  "Leviathan",
  "Moonbeam",
  "Esperanto",
  "Taxi",
  "Washington",
  "Bobcat",
  "Mr Whoopee",
  "BF Injection",
  "Hunter",
  "Premier",
  "Enforcer",
  "Securicar",
  "Banshee",
  "Predator",
  "Bus",
  "Rhino",
  "Barracks",
  "Hotknife",
  "Trailer",
  "Previon",
  "Coach",
  "Cabbie",
  "Stallion",
  "Rumpo",
  "RC Bandit",
  "Romero",
  "Packer",
  "Monster Truck",
  "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",
  "Hotring Racer",
  "Bloodring Banger",
  "Rancher",
  "Super GT",
  "Elegant",
  "Journey",
  "Bike",
  "Mountain Bike",
  "Beagle",
  "Cropdust",
  "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 Truck",
  "Monster Truck",
  "Uranus",
  "Jester",
  "Sultan",
  "Stratum",
  "Elegy",
  "Raindance",
  "RC Tiger",
  "Flash",
  "Tahoma",
  "Savanna",
  "Bandito",
  "Freight",
  "Trailer",
  "Kart",
  "Mower",
  "Duneride",
  "Sweeper",
  "Broadway",
  "Tornado",
  "AT-400",
  "DFT-30",
  "Huntley",
  "Stafford",
  "BF-400",
  "Newsvan",
  "Tug",
  "Trailer",
  "Emperor",
  "Wayfarer",
  "Euros",
  "Hotdog",
  "Club",
  "Trailer",
  "Trailer",
  "Andromada",
  "Dodo",
  "RC Cam",
  "Launch",
  "Police Car (LSPD)",
  "Police Car (SFPD)",
  "Police Car (LVPD)",
  "Police Ranger",
  "Picador",
  "S.W.A.T. Van",
  "Alpha",
  "Phoenix",
  "Glendale",
  "Sadler",
  "Luggage Trailer",
  "Luggage Trailer",
  "Stair Trailer",
  "Boxville",
  "Farm Plow",
  "Utility Trailer"
};

logo.png

ATENTIE!!! Nu imi trimiteti mesaje private care au legatura cu scriptingul. NU mai scriptez.

Link to comment
Share on other sites

Am rezolvat cu asta am mai dezvoltato ;)

    if(strcmp(cmd,"/tow",true)==0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(PlayerInfo[playerid][pJob] == 7)
            {
                if(IsPlayerInAnyVehicle(playerid))
                {
                    new m = GetVehicleModel(GetPlayerVehicleID(playerid));
                    if (m == 525 || m == 552)
                        {
                            if(GetPlayerState(playerid)==2)
                            {
                            new Float:pX,Float:pY,Float:pZ;
                            GetPlayerPos(playerid,pX,pY,pZ);
                            new Float:vX,Float:vY,Float:vZ;
                            new Found=0;
                            new vid=0;
                            while((vid<MAX_VEHICLES)&&(!Found))
                            {
                                   vid++;
                                   GetVehiclePos(vid,vX,vY,vZ);
                                   if ((floatabs(pX-vX)<7.0)&&(floatabs(pY-vY)<7.0)&&(floatabs(pZ-vZ)<7.0)&&(vid!=GetPlayerVehicleID(playerid)))
                                {
                                       Found=1;
                                       if(IsTrailerAttachedToVehicle(GetPlayerVehicleID(playerid)))
                                       {
                                           DetachTrailerFromVehicle(GetPlayerVehicleID(playerid));
                                       }
                                       else
                                       {
                                        AttachTrailerToVehicle(vid,GetPlayerVehicleID(playerid));
                                    }
                                 }
                             }
                            if(!Found)
                             {
                                   SendClientMessage(playerid,0xFFFF00AA,"There is no car in range.");
                               }
                        }
                        else
                        {
                            SendClientMessage(playerid, COLOR_GRAD2, "You need to be the driver!");
                            return 1;
                        }
                    }
                    else
                    {
                        SendClientMessage(playerid, COLOR_GRAD2, "You need to be in a Tow truck to use this!");
                        return 1;
                    }
                }
                else
                {
                    SendClientMessage(playerid, COLOR_GRAD2, "You need to be in a vehicle to do this!");
                    return 1;
                }
            }
            else
            {
                SendClientMessage(playerid,COLOR_GRAD2,"You need to be a Mechanic to use this!");
                return 1;
            }
        }
        return 1;
    }

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
  • Similar Content

    • By salexm93
      Salut ,pot adauga cod la apelarea functiilor native ? De ex la CreatePickup am nevoie sa salvez date pe care sa le accesez la OnPlayerPickUpPickup(playerid, pickupid)
    • By Tefyuu
      Salut , in gamemode ul burned by waller , cum adaug pet in shop ? am incercat eu ceva dar nu a aparut si am zis sa va intreb
    • By Xtrem_Maddox
      Salut. O să explic cât se poate de scurt.
      Mi-am modelat singur o casă în Blender. Am exportat modelul, l-am adăugat în .pwn, e ready to use. Problema mea este următoarea: vreau să amplasez casa undeva, nu contează unde, doar că trebuie să mappez casa, adică să o pun eu cum trebuie. Asta înseamnă că trebuie s-o adaug într-un map editor, ca să o așez așa cum vreau. Cum fac lucrul acesta? Mai exact: cum adaug un obiect custom într-un map editor? JernejL's Map Editor nu îți dă voie să adaugi propriile tale obiecte, nu? Dar Fusez'?
      Mulțumesc.
    • By Sebi wepos
      Cum adaug si eu zcmd in gamemode meu?
      adk stiu sa pun in include zcmd 
      dar nush cum sa pun include si alea sa mearga ca daca fac cum cred eu ca e imi da o eroare 
    • By Tefyuu
      Salut , stie cineva cum sa adaug masini la o factiune sau sa fac chestia cu /svf ? Sunt la inceput cu scripting ul nu le prea am
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.