Load a crate into a vehicle
#1

So I'm trying to load a crate into a boxville, but I'm not quite sure what function to use. I thought of using IsPlayerInRangeOfPoint, but I realized that I didn't know whether that function could replace the coordinates with a variable or not.

Three boxville's were created and given the ID:

new boxvilleID1,
boxvilleID2,
boxvilleID3;

I even created a variable for crate.

The question is, how am I supposed to load a crate to a boxville?
Reply
#2

You can make enums for vehicle for example that if that boxville got the enum [vCrate] = 1 then it has a crate inside, if 0 then it doesn't have, this is a simple way of making it..
Reply
#3

Quote:
Originally Posted by JasonRiggs
Посмотреть сообщение
You can make enums for vehicle for example that if that boxville got the enum [vCrate] = 1 then it has a crate inside, if 0 then it doesn't have, this is a simple way of making it..
But how will I make the command itself? How will I tell the script to load the actual crate into one of these boxvilles when I'm close enough?

This is what I've got so far:

CMD:loadcrateboxville(playerid, params)
{
if(PlayerInfo[playerid][pCrate] = 1) &&
{

}

}
Reply
#4

Quote:
Originally Posted by Mo123
Посмотреть сообщение
But how will I make the command itself? How will I tell the script to load the actual crate into one of these boxvilles when I'm close enough?

This is what I've got so far:

CMD:loadcrateboxville(playerid, params)
{
if(PlayerInfo[playerid][pCrate] = 1) &&
{

}

}
This isn't a request forum for script and codes - You'll have to do that yourself, we only provide support for code you're having trouble with.

Assuming from the little knowledge I've about what exactly you want to do, you'll need an array with size-of MAX_VEHICLES with an enumerator, and then you may give player some animation, some attached object, and use some function to detect whether they are going are behind the vehicle or not, if they are then you just remove the attached object, the animation, and assign some value to the specified array.
Reply
#5

Take a look at my LS-RP trucking script replica

https://github.com/offsetX/Base-Role...king_alpha.pwn

it's ready to use though but I'd suggest you to learn the code because they are really easy to understand and the question you asked is solved there
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)