Train per Command - 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: Train per Command (
/showthread.php?tid=163262)
Train per Command -
Arrows73 - 26.07.2010
Hi,
is it possible to spawn a train via a command? Or just with AddStaticVehicleEx?
Thanks in advance
Re: Train per Command -
Shadow™ - 26.07.2010
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.
Re: Train per Command -
Kar - 26.07.2010
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.
Re: Train per Command -
Arrows73 - 26.07.2010
@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
Re: Train per Command -
mastasquizy - 26.07.2010
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"
Re: Train per Command -
Arrows73 - 26.07.2010
I use dcmd too
Ive now done it with addstaticvehicleex