#1

How detect if the trailer (Vehicle ID: 435) is acctached to the vehicle he drive?

Like, if you drive a trucker.. and attach the trailer (ID:435)... "You attached the trailer. ID: 435"
and just for that ID...

and if you attach ID: 450 or something then you get no message, ok?
Reply
#2

pawn Код:
public OnPlayerEnterVehicle( playerid, vehicleid ) {
    if( IsPlayerInVehicle( 435 ) ) {
        new
            str[ MAX_STRINGS ] ;
        format( str, sizeof( str ), " You are in trailer 435 " ) ;
        SendClientMessage( playerid, COLOR, str ) ;
    }
    else if( IsPlayerInVehicle( 450 ) ) { }
    return 0;
}
correct me if its wrong..
Reply
#3

in the command or key state change where you put the attaching code, add a check for the vehicle id, if it is satisfied then Send message. (if you dont understand post your attaching code here ill modify it)
Reply
#4

Quote:
Originally Posted by AK47317
Посмотреть сообщение
pawn Код:
public OnPlayerEnterVehicle( playerid, vehicleid ) {
    if( IsPlayerInVehicle( 435 ) ) {
        new
            str[ MAX_STRINGS ] ;
        format( str, sizeof( str ), " You are in trailer 435 " ) ;
        SendClientMessage( playerid, COLOR, str ) ;
    }
    else if( IsPlayerInVehicle( 450 ) ) { }
    return 0;
}
correct me if its wrong..
Yes right.
Reply
#5

Quote:
Originally Posted by Davz*|*Criss
Посмотреть сообщение
Yes right.
No, he is wrong.
He is creating a new string, with a "MAX_STRING" size, where it is not needed.
Reply
#6

Quote:
Originally Posted by mrcoolballs
Посмотреть сообщение
No, he is wrong.
He is creating a new string, with a "MAX_STRING" size, where it is not needed.
ur mocking my string?
Reply
#7

Quote:
Originally Posted by AK47317
Посмотреть сообщение
pawn Код:
public OnPlayerEnterVehicle( playerid, vehicleid ) {
    if( IsPlayerInVehicle( 435 ) ) {
        new
            str[ MAX_STRINGS ] ;
        format( str, sizeof( str ), " You are in trailer 435 " ) ;
        SendClientMessage( playerid, COLOR, str ) ;
    }
    else if( IsPlayerInVehicle( 450 ) ) { }
    return 0;
}
correct me if its wrong..
Umm, i will get the message if i enter a TRAILER if im not wrong, right?
But i wanted the message if a tuck attach the trailer id 435
Reply
#8

Quote:
Originally Posted by AK47317
Посмотреть сообщение
ur mocking my string?
Not mocking, correcting.

pawn Код:
public OnPlayerEnterVehicle( playerid, vehicleid ) {
    if( IsPlayerInVehicle( 435 ) ) {

        SendClientMessage( playerid, COLOR,  " You are in trailer 435 " ) ;
    }
    else if( IsPlayerInVehicle( 450 ) ) { }
    return 0;
}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)