How to enter a TRAM using F/G or default enter key.
#1

Title says it all.

More info: So I have decide to put Tram in my server, I do put coordinates in nearest Tram rails in San Fiero. and it automatically fits the rails. Now after trying to use F or Enter it doesn't work.

Why?? It's a vehicle right?
Reply
#2

I've never had this issue, do you have it as like,

'AddStaticVehicleEx' ?
Reply
#3

Quote:
Originally Posted by Akira297
Посмотреть сообщение
I've never had this issue, do you have it as like,

'AddStaticVehicleEx' ?
I did is CreateVehicle, Do I need to change it to AddStaticVehicleEx?

EDIT: Under OnGameModeInit AddStaticVehicleEx(449,-1703.9751,1317.3466,7.0391,49.3740,6,2,60); STILL no luck
Reply
#4

Still can't enter what's the problem?
Reply
#5

Use PutPlayerInVehicle
Reply
#6

Quote:
Originally Posted by ReVo_
Посмотреть сообщение
Use PutPlayerInVehicle
Can you do this for me? If player is near a tram and do F/G ir Enter then putplayerinvehicle..
Reply
#7

OnPlayerKeyStateChange

if( newkeys & KEY_JOIN ) {
new Float:vx, Float:vy, Float:vz;
for( new x = 0; x < MAX_VEHICLES; x ++ ) {
if(GetVehicleModel(x) == tram_models) {
GetVehiclePos( x, vx , vy, vz );
if( IsPlayerInRangeOfPoint( playerid , 1.5 , vx, vy, vz )) {
PutPlayerInVehicle( playerid , x, as_driver );
}
}
}

If he press "passenger key" do the same change only seat id.. mb with a for to check all seats and if one is avaitable put player here


sorry for english, i write everything (code and this text) fast because i had to go
Reply
#8

Quote:
Originally Posted by ReVo_
Посмотреть сообщение
OnPlayerKeyStateChange

if( newkeys & KEY_JOIN ) {
new Float:vx, Float:vy, Float:vz;
for( new x = 0; x < MAX_VEHICLES; x ++ ) {
if(GetVehicleModel(x) == tram_models) {
GetVehiclePos( x, vx , vy, vz );
if( IsPlayerInRangeOfPoint( playerid , 1.5 , vx, vy, vz )) {
PutPlayerInVehicle( playerid , x, as_driver );
}
}
}

If he press "passenger key" do the same change only seat id.. mb with a for to check all seats and if one is avaitable put player here


sorry for english, i write everything (code and this text) fast because i had to go
OMG! Thanks revo but i have few warnings left

pawn Код:
(13344) : warning 225: unreachable code
(13344) : error 017: undefined symbol "KEY_JOIN"
(13347) : error 017: undefined symbol "tram_models"
(13350) : error 017: undefined symbol "as_driver"
pawn Код:
(13344) if( newkeys & KEY_JOIN ) {
(13347)if(GetVehicleModel(x) == tram_models) {
(13350)PutPlayerInVehicle( playerid , x, as_driver );
Reply
#9

------
Reply
#10

Quote:
Originally Posted by ReVo_
Посмотреть сообщение
Emh you need to change KEY_JOIN with the key player press when he try to join in a vehicle..

tram_models => with models of vehicle you want

as_driver => with 0
Thanks 2 warning same line left..

Why is G for enter as a passanger is underfined? is there any key for G?
https://sampwiki.blast.hk/wiki/GetPlayerKeys
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)