On Trailer Attach function.
#1

How can I make it so when a truck attaches to a trailer it will do something. Like just for a test I would like to do it so that when I attach a trailer it sends me a message "Test".
How can I do this? Any Tuts? Thanks.
Reply
#2

PHP код:
public OnTrailerUpdate(playeridvehicleid)
{
    
SendClientMessage(playerid, -1"Test");
    return 
1;

Keep this in mind though:
Reply
#3

Quote:
Originally Posted by Jimmy0wns
Посмотреть сообщение
PHP код:
public OnTrailerUpdate(playeridvehicleid)
{
    
SendClientMessage(playerid, -1"Test");
    return 
1;

Keep this in mind though:
That won't work for some reason.. The code works and all but it won't do anything ingame..
Reply
#4

OnTrailerUpdate is related to players syncing trailer's positions, not about attaching them. You have to make your own callback using IsTrailerAttachedToVehicle/GetVehicleTrailer. Monitor when the values change under OPU.
Reply
#5

https://sampwiki.blast.hk/wiki/IsTrailerAttachedToVehicle
https://sampwiki.blast.hk/wiki/GetVehicleTrailer
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)