SetVehicleParamsEx
#1

Hello!

How do i get "SetVehicleParamsEx" work? i mean every time i use that i get errors that it isnt defined.
Do i missing a include? and i cant #define, then i get some errors somewhere else

im trying to make so when you get out of fuel, the engine stops running, i even dont know if this will work at all

script not made by me!
pawn Код:
public timer_update()
{
    for(new i=0;i<MAX_PLAYERS;i++) {
        if (isrefuelling[i]) return 0;
        new vid = GetPlayerVehicleID(i);
        if (GetPlayerVehicleSeat(i) == 0) {
            fuel[vid] = fuel[vid] - 1;
            if (fuel[vid]<1)
            {
                fuel[vid] = 0;
                Engine[i]=0;
                GameTextForPlayer(i,"~r~You are out of ~w~fuel~r~!",5000,4);
                SetVehicleParamsEx(GetPlayerVehicleID(playerid),0,lights,alarm,doors,bonnet,boot,objective);
            }
        }
        new string[128];format(string,sizeof string,"Fuel: %i",fuel[vid] /3);
        TextDrawSetString(td_fuel[i],string);
    }
    return 1;
}
Reply
#2

You need the 0.3c includes, evidently. However you're trying to set the parameters of the vhicles with variables that haven't been declared. In order to obtain the current values you need to use GetVehicleParamsEx first.
Reply
#3

Quote:
Originally Posted by Vince
Посмотреть сообщение
You need the 0.3c includes, evidently. However you're trying to set the parameters of the vhicles with variables that haven't been declared. In order to obtain the current values you need to use GetVehicleParamsEx first.
Yeah i know, but i get error on "GetVehicleParamsEx" and "SetVehicleParamsEx" all the time even if i have the variables.
So, what 0.3c includes are you talking about? and were do i get them?

EDIT: nvm..i had the older release of the server client..
Reply
#4

Did you define these:

pawn Код:
engine,lights,alarm,doors,bonnet,boot,objective
If not, then define them:

pawn Код:
new engine,lights,alarm,doors,bonnet,boot,objective;
If you still get the warnings or errors that SetVehicleParamsEx about not defined, then you should download the latest includes from the download section like Vince said.
Reply
#5

Quote:
Originally Posted by Unte99
Посмотреть сообщение
Did you define these:

pawn Код:
engine,lights,alarm,doors,bonnet,boot,objective
If not, then define them:

pawn Код:
new engine,lights,alarm,doors,bonnet,boot,objective;
If you still get the warnings or errors that SetVehicleParamsEx about not defined, then you should download the latest includes from the download section like Vince said.
I did, i hade a old download, so i have downloaded the newest one and it does work now
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)