I need help in making Commands
#3

https://sampforum.blast.hk/showthread.php?tid=456280

Follow the instructions what is explained in the tutorial.Once you catch up the basics, try these:
To add a vehicle there are two functions namely AddStaticVehicle and CreateVehicle.AddStaticVehicle will not do well here because it cannot be use outside OnGameModeInit.So you'll have be using CreateVehicle.Specify the parameters into the function.You can get the location where to spawn using GetPlayerPos(Type in the wiki search box and it will show the details).

CreateVehicle - https://sampwiki.blast.hk/wiki/CreateVehicle

An idea:
Quote:

COMMAND:vspawn(playerid,params[])
{
new mid,c1,c2,Float,Float:y,Float:z,Float:ror,string[256];
if(sscanf(params,"iii",mid,c1,c2)) { return SendClientMessage(playerid,0xEEEEEE,"Usage:/vspawn [mid] [color1] [color2]"); }
GetPlayerPos(playerid,x,y,z);
GetPlayerFacingAngle(playerid,ror);
new vid = CreateVehicle(mid,x,y,z,ror,c1,c2,60000);
if(vid == INVALID_VEHICLE_ID) { return SendClientMessage(playerid,COLOR_RED,"Invalid Parameters"); }
format(string,sizeof(string),"Vehicle ID:%d ModelID:%s(%d) Color1:%d Color2:%d",vid,VehicleNames[mid-400],mid,c1,c2);
SendClientMessage(playerid,COLOR_GREEN,string);
PutPlayerInVehicle(playerid,vid,0);
return 1;
}

Reply


Messages In This Thread
I need help in making Commands - by MAFIAWARS - 01.09.2013, 08:04
Re : I need help in making Commands - by 1Geek - 01.09.2013, 08:23
Re: I need help in making Commands - by Yashas - 01.09.2013, 09:02
Re: I need help in making Commands - by MAFIAWARS - 01.09.2013, 09:47
Re: I need help in making Commands - by Yashas - 01.09.2013, 10:58
Re: I need help in making Commands - by xganyx - 01.09.2013, 11:11
Re: I need help in making Commands - by Konstantinos - 01.09.2013, 12:40
Re: I need help in making Commands - by MAFIAWARS - 01.09.2013, 13:19

Forum Jump:


Users browsing this thread: 1 Guest(s)