SA-MP Forums Archive
Vehicle Selection - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Vehicle Selection (/showthread.php?tid=176950)



Vehicle Selection - Cameltoe - 15.09.2010

Hello, i need help on something here .. I'm trying to make an vehicle selector.

Here's what i got so far:

pawn Код:
// The range of cars
new CarModels[7] = {
    562,
    400,
    402,
    424,
    426,
    603
};
// The function
function ShowCars(playerid)
{
PlayerInfo[playerid][CreatedCar] = CreateVehicle(PlayerInfo[playerid][ShowingCar], -     1953.5547,257.6832,40.7763,290.3900, Color, Color, 60*10000);
    LinkVehicleToInterior(PlayerInfo[playerid][CreatedCar], GetPlayerInterior(playerid));
    SetVehicleVirtualWorld(PlayerInfo[playerid][CreatedCar], GetPlayerVirtualWorld(playerid));
}

// OnPlayerKey callbck
if(PRESSED(KEY_ANALOG_LEFT))
    {
        SendInfoMessage(playerid, "Left");
        PlayerInfo[playerid][ShowingCar] = CarModels[PlayerInfo[playerid][ShowingCar]-1];
        ShowCars(playerid);
    }
    if(PRESSED(KEY_ANALOG_RIGHT))
    {
        SendInfoMessage(playerid, "Right");
        PlayerInfo[playerid][ShowingCar] = CarModels[PlayerInfo[playerid][ShowingCar]+1];
        ShowCars(playerid);
    }
I'm trying to make a Vehicle selection script, just like class selection but with vehicles, i been trying for days without any luck .. so i decided to try here

Thanks


Re: Vehicle Selection - [XST]O_x - 15.09.2010

pawn Код:
if(PRESSED(KEY_ANALOG_LEFT))
    {
        SendInfoMessage(playerid, "Left");
        PlayerInfo[playerid][ShowingCar] = CarModels[PlayerInfo[playerid][ShowingCar]-1];
        ShowCars(playerid);
        return 1;
    }
    if(PRESSED(KEY_ANALOG_RIGHT))
    {
        SendInfoMessage(playerid, "Right");
        PlayerInfo[playerid][ShowingCar] = CarModels[PlayerInfo[playerid][ShowingCar]+1];
        ShowCars(playerid);
        return 1;
    }
Pretty unsure though, try.

Just to be sure, you know KEY_ANALOG_RIGHT and KEY_ANALOG_LEFT are num4 and num6 keys right?


Re: Vehicle Selection - Cameltoe - 15.09.2010

Quote:
Originally Posted by [XST]O_x
Посмотреть сообщение
Pretty unsure though, try.
- Thanks for trying, The problem isn't the keystrokes, the keys are being pressed as the message gets sent, but it just doesn't change model ..


Re: Vehicle Selection - Will77 - 15.09.2010

You sure you aint missing any brackets?


Re: Vehicle Selection - Cameltoe - 15.09.2010

Quote:
Originally Posted by Will77
Посмотреть сообщение
You sure you aint missing any brackets?
- Thanks, really this just wont work.....


Re: Vehicle Selection - LarzI - 15.09.2010

I once made something like this myself, but never finished.
I dno if it will help you any, but take a look at it:

http://pastebin.com/AkqtFhg7


Re: Vehicle Selection - Cameltoe - 15.09.2010

Quote:
Originally Posted by LarzI
Посмотреть сообщение
I once made something like this myself, but never finished.
I dno if it will help you any, but take a look at it:

http://pastebin.com/AkqtFhg7
Yeah lol, we came to the exact same place!


Re: Vehicle Selection - LarzI - 15.09.2010

Hmm, yeah I saw, but I think I figured it out..
Check it out yourself:

http://pastebin.com/jQ8n96W2


Re: Vehicle Selection - Cameltoe - 15.09.2010

Quote:
Originally Posted by LarzI
Посмотреть сообщение
Hmm, yeah I saw, but I think I figured it out..
Check it out yourself:

http://pastebin.com/jQ8n96W2
Yeah just a sec lol, struggling with "world boundries" without even setting them in the firstplace xD lol.


Re: Vehicle Selection - Cameltoe - 15.09.2010

Got it working now thanks for ideas!