SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 20/08/2012, 10:04 AM   #1
JEkvall95
Huge Clucker
 
Join Date: Jun 2012
Posts: 348
Reputation: 1
Default Tram

I have added a tram to san fiero.
I've added it as a static vehicle. in the city's railroads but why cant I drive it? I can only get in as a passenger
JEkvall95 is offline   Reply With Quote
Old 20/08/2012, 10:20 AM   #2
JEkvall95
Huge Clucker
 
Join Date: Jun 2012
Posts: 348
Reputation: 1
Default Re: Tram

bump I would like some help :/ srry
JEkvall95 is offline   Reply With Quote
Old 20/08/2012, 10:25 AM   #3
_Jake_
High-roller
 
_Jake_'s Avatar
 
Join Date: Apr 2012
Location: Land of Ooo
Posts: 2,357
Reputation: 244
Default Re: Tram

This is untested.
But give it a try maybe it work.

Put this OnPlayerKeyStateChange

pawn Code:
if(newkeys & 16)
{
    new Float:vx, Float:vy, Float:vz;
    if(IsPlayerInAnyVehicle(playerid) && GetVehicleModel(GetPlayerVehicleID(playerid)) == 449)
    {
        GetVehiclePos(GetPlayerVehicleID(playerid), vx, vy, vz);
        SetPlayerPos(playerid, vx, vy, vz);
        return 1;
    }
    for(new v; v < MAX_VEHICLES; v++)
    {
        GetVehiclePos(v, vx, vy, vz);
        if(IsPlayerInRangeOfPoint(playerid, 8, vx, vy, vz) && GetVehicleModel(GetPlayerVehicleID(playerid)) == 449)
        {
            PutPlayerInVehicle(playerid, v, 0);
            return 1;
        }
    }
}
__________________

"Some times a man should retrieve his own disk"
- by Finn The Human

My official forum
Click Here

Los Santos Prison Roleplay coming soon!
_Jake_ is offline   Reply With Quote
Old 20/08/2012, 10:26 AM   #4
JEkvall95
Huge Clucker
 
Join Date: Jun 2012
Posts: 348
Reputation: 1
Default Re: Tram

ok ill try
JEkvall95 is offline   Reply With Quote
Old 20/08/2012, 10:28 AM   #5
JEkvall95
Huge Clucker
 
Join Date: Jun 2012
Posts: 348
Reputation: 1
Default Re: Tram

Quote:
Originally Posted by Romel View Post
This is untested.
But give it a try maybe it work.

Put this OnPlayerKeyStateChange

pawn Code:
if(newkeys & 16)
{
    new Float:vx, Float:vy, Float:vz;
    if(IsPlayerInAnyVehicle(playerid) && GetVehicleModel(GetPlayerVehicleID(playerid)) == 449)
    {
        GetVehiclePos(GetPlayerVehicleID(playerid), vx, vy, vz);
        SetPlayerPos(playerid, vx, vy, vz);
        return 1;
    }
    for(new v; v < MAX_VEHICLES; v++)
    {
        GetVehiclePos(v, vx, vy, vz);
        if(IsPlayerInRangeOfPoint(playerid, 8, x, y, z) && GetVehicleModel(GetPlayerVehicleID(playerid)) == 449)
        {
            PutPlayerInVehicle(playerid, v, 0);
            return 1;
        }
    }
}
could u give it a test? because u can drive a tram on normal railroads but not in the san fiero :S if u understand
JEkvall95 is offline   Reply With Quote
Old 20/08/2012, 10:28 AM   #6
_Jake_
High-roller
 
_Jake_'s Avatar
 
Join Date: Apr 2012
Location: Land of Ooo
Posts: 2,357
Reputation: 244
Default Re: Tram

let me try..
__________________

"Some times a man should retrieve his own disk"
- by Finn The Human

My official forum
Click Here

Los Santos Prison Roleplay coming soon!
_Jake_ is offline   Reply With Quote
Old 20/08/2012, 10:30 AM   #7
_Jake_
High-roller
 
_Jake_'s Avatar
 
Join Date: Apr 2012
Location: Land of Ooo
Posts: 2,357
Reputation: 244
Default Re: Tram

Yup it work.
__________________

"Some times a man should retrieve his own disk"
- by Finn The Human

My official forum
Click Here

Los Santos Prison Roleplay coming soon!
_Jake_ is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with a tram Dripac Scripting Help 7 03/04/2012 07:32 PM
Help for Tram Join7 Scripting Help 10 17/11/2011 01:14 PM
I need help with Tram Join7 Scripting Help 1 16/10/2011 09:48 AM
Bug la Tram? [TM]Hitman Română/Romanian 3 25/05/2011 01:47 PM
SA:MP Tram Fun Davz Screenshots and Videos 14 29/12/2009 12:36 PM


All times are GMT. The time now is 04:16 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.