[HELP] Creating optional command parameters
#1

Код:
CMD:car(playerid,params[])
{
	new string[128],cID,cID2,vID;
	new Float:x,Float:y,Float:z;
    if(PInfo[playerid][Level] < 1)
    return SendClientMessage(playerid,STEALTH_BLUE,"You need to be level 2 to use this command.");
	if(sscanf(params,"dzz",vID,cID,cID2))
	return SendClientMessage(playerid,COLOR_INDIANRED,"USAGE /car [NAME] Optional: [COLOR1] [COLOR2]");
	if(vCar[playerid] != -1)
		{
 			DestroyVehicle(vCar[playerid]);
		}
	CMDMessageToAdmins(playerid,"CAR");
	GetPlayerPos(playerid,x,y,z);
	vCar[playerid] = CreateVehicle(vID,x+2,y,z,0,cID,cID2,0);
	PutPlayerInVehicle(playerid,vCar[playerid], 0);
	LinkVehicleToInterior(vCar[playerid], GetPlayerInterior(playerid));
	format(string,sizeof(string),"You have spawned vehicle %d with color %d and %d.",vID,cID,cID2);
	SendClientMessage(playerid,COLOR_GREENYELLOW,string);
    return 1;
}
How do i create optional parameters for cID and cID2
Reply


Messages In This Thread
[HELP] Creating optional command parameters - by Nabster - 08.03.2015, 07:41
Re: [HELP] Creating optional command parameters - by X337 - 08.03.2015, 07:51
Re: [HELP] Creating optional command parameters - by biker122 - 08.03.2015, 08:20
Re: [HELP] Creating optional command parameters - by Nabster - 08.03.2015, 09:00

Forum Jump:


Users browsing this thread: 5 Guest(s)