Train per Command
#1

Hi,
is it possible to spawn a train via a command? Or just with AddStaticVehicleEx?

Thanks in advance
Reply
#2

Train's aren't really... Possible, if you spwn a train it'll move to the closest train-tracks - so if you're not near the tracks ^.^ There goes the train.
Reply
#3

you save ur coords. then add static vehicle and put the train id u gotta do this near the tracks then when u go on

u'lll see your train.
Reply
#4

@Kar: I know how to do it, I just wanted to know if its possible with CreateVehicle instead of AddStaticVehicleEx because I dont see any train
Reply
#5

There is so a way to spawn a train via command. xP

I use dcmd btw so try to follow:
pawn Код:
dcmd_vehicle(playerid,params[])
{
    new carid,car;
    if(!PlayerInfo[playerid][admin]) return 0;
    if(sscanf(params,"i",carid))
    {
        SendClientMessage(playerid,0x00AA00AA,"[!] Usage: /vehicle (car id #)");
    }
    else
    {
        new str[256],Float:x,Float:y,Float:z,Float:a;
        GetPlayerPos(playerid,x,y,z);
        GetPlayerFacingAngle(playerid,a);
        if(carid==537 || carid==538)//if its a train, use AddStaticVehicleEx
        {
            new train;
            train = AddStaticVehicleEx(carid,x,y,z,a,-1,-1,10000000000000000);
            PutPlayerInVehicle(playerid,train,0);
        }
        else
        {
            car = CreateVehicle(carid,x,y,z,a,-1,-1,10000000000000);
            PutPlayerInVehicle(playerid,car,0);
        }
        format(str,sizeof(str),"[!] Vehicle #%d spawned",carid);
        SendClientMessage(playerid,0x00AAAAAA,str);
    }
    return 1;
}
bottom line: You spawn a train like you spawn any type of vehicle, except instead of "CreateVehicle" you would use "AddStaticVehicleEx"
Reply
#6

I use dcmd too

Ive now done it with addstaticvehicleex
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)