SA-MP Forums Archive
What IS vehicleid - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: What IS vehicleid (/showthread.php?tid=410267)



What IS vehicleid - jakejohnsonusa - 24.01.2013

So I have a slight problem with the dini in my GM, which is leading me to ask... WHAT IS "vehicleid" Is it the ID # in which the vehicle is loaded or... what?

I'm newish to scripting (few months) so please speak simple for me. Thanks!

-jakejohnsonusa


Re: What IS vehicleid - Infinity90 - 24.01.2013

vehicle id is the model of the vehicle (I'am not 100% sure though).


Re: What IS vehicleid - jakejohnsonusa - 24.01.2013

No, I know thats not what it is...
That's GetVehicleModel

Anyone know?

(I think GetPlayerVehicleID is the same thing as vehicleid ... But what is that?)


Re : What IS vehicleid - lelemaster - 24.01.2013

vehicleid could be everything. It's only a variable tho. The one that make your script could have wrote 'vid', 'vehid', 'potato'. He just wanted the codes to be understandable so he wrote vehicleid.

A vehicle ID is basicly going with GetPlayerVehicleID();
When you do /dl in game, you'll see the vehicle ID.


Re: What IS vehicleid - jakejohnsonusa - 24.01.2013

Right, so GetPlayerVehicleID is vehicleid in my GM. However what does the number from GetPlayerVehicleID represent?


Re: What IS vehicleid - Sime30 - 24.01.2013

No, Vehicle ID is the vehicle already put in your script, I mean look this

pawn Код:
AddStaticVehicleEx(428, 1544.2725830078, -1684.3175048828, 5.8806247711182, 90, 0, 1,300); //Securicar 1 - This is your first vehicle in script so his vehicle ID would be 1
    AddStaticVehicleEx(428, 1544.2365722656, -1676.2415771484, 5.8806247711182, 90, 0, 1,300); //Securicar 2
    AddStaticVehicleEx(428, 1544.1998291016, -1667.8420410156, 5.8806247711182, 90, 0, 1,300); //Securicar 3
    AddStaticVehicleEx(428, 1544.0983886719, -1659.0190429688, 5.8806247711182, 90, 0, 1,300); //Securicar 4
You can use vehicle ID in some commands, here take a look
pawn Код:
CMD:rentmoto(playerid, params[])
    {
        new string[128];
        if(IsPlayerConnected(playerid))
        {
            if(GetPlayerVehicleID(playerid) >= 193 && GetPlayerVehicleID(playerid) <= 217) // These numbers are for the vehicles, so the vehicles between number 193 and 217 are rentbikes (This is from my script)
// You must calculate those numbers by yourself
            {
                new hirefee = HireCost(GetPlayerVehicleID(playerid));
                if (GetPlayerMoney(playerid) <  SBizzInfo[0][sbEntranceCost])
                {
                    SendClientMessage(playerid, COLOR_GRAD2, "Nemate dovoljno novaca !");
                    return 1;
                }
                if(HireCar[playerid] != 299)
                {
                    gCarLock[HireCar[playerid]] = 0;
                    UnLockCar(HireCar[playerid]);
                    SendClientMessage(playerid, COLOR_GREY, "Vi vec iznajmljujete auto / motor !");
                    return 1;
                }
                foreach (Player, i)
                {
                    if(HireCar[i] == GetPlayerVehicleID(playerid))
                    {
                        SendClientMessage(playerid, COLOR_GREY, "Netko vec iznajmljuje ovaj motor !");
                        return 1;
                    }
                }
                GivePlayerCash(playerid,-SBizzInfo[0][sbEntranceCost]);
                SBizzInfo[0][sbTill] += SBizzInfo[0][sbEntranceCost];
                ExtortionSBiz(0, SBizzInfo[0][sbEntranceCost]);
                SBizzInfo[0][sbProducts]--;
                HireCar[playerid] = GetPlayerVehicleID(playerid);
                OnPropUpdate();
                PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
                format(string, sizeof(string), "Unajmili ste motor, sada samo vi mozete voziti ovaj motor.",hirefee);
                SendClientMessage(playerid, YELLOW, string);
                TogglePlayerControllable(playerid, 1);
                gEngine[GetPlayerVehicleID(playerid)] = 1;
                GameTextForPlayer(playerid, string, 5000, 3);
            }
        }
        return 1;
    }
Reply if I helped you. P.S. I don't know english very well so I couldn't help you a lot 'cuz I don't know how to express myself


Re: What IS vehicleid - jakejohnsonusa - 24.01.2013

PERFECT! +1 Rep!

That will help me with my problem!


Re: What IS vehicleid - Sime30 - 24.01.2013

I am glad I helped you out!