Attach
#1

how can i make that if the truck pickups a trailer it does a funcion?

Ps: sry can't talk good in english
Reply
#2

This is what iґm using, works very well in my script atleast.


On top:
pawn Код:
forward TrailerAttaching(playerid);
new TrailerTimer;

a simple public
pawn Код:
public TrailerAttaching(playerid)
{
    if(IsPlayerInAnyVehicle(playerid))
    {
      if(IsTrailerAttachedToVehicle(GetPlayerVehicleID(playerid)))
      {
      SendClientMessage(playerid,COLOR_WHITE,"A trailer has been attached to your vehicle!");
      KillTimer(TrailerTimer);
      }
    }


}
OnPlayerStateChange()
pawn Код:
if(!IsTrailerAttachedToVehicle(GetPlayerVehicleID(playerid)))
{
TrailerTimer = SetTimer("TrailerAttaching",1000,true);
}

If you are using a /detach command you may start the timer again when detached
Reply
#3

Also post this, else you will get errors:
IsTrailerAttachedToVehicle(GetPlayerVehicleID(play erid))
Reply
#4

thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)