Umm - 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: Umm (
/showthread.php?tid=243886)
Umm - Unknown123 - 25.03.2011
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?
Re: Umm -
AK47317 - 25.03.2011
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..
Re: Umm -
THE_KNOWN - 25.03.2011
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)
Re: Umm -
Davz*|*Criss - 25.03.2011
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.
Re: Umm -
mrcoolballs - 25.03.2011
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.
Re: Umm -
AK47317 - 25.03.2011
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?
Re: Umm - Unknown123 - 25.03.2011
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
Re: Umm -
mrcoolballs - 25.03.2011
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;
}