SA-MP Forums Archive
Unkown 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)
+--- Thread: Unkown Command (/showthread.php?tid=549786)



Unkown Command - Blademaster680 - 08.12.2014

Hi

I am busy making a trackveh command so players can track their owned vehicles, but keeps giving me Unknown command in-game and dont understand why.

Код:
CMD:trackveh(playerid, params[])
{
	new carid[10], str[25], model, count = 1, vid, carlist[500];
	for(new i = 0; i < MAX_VEHICLES; i++)
	{
		vid = GetVehicleID(i);
		if(strcmp(vInfo[vid][vOwner], GetNameEx(playerid), true) == 0)
		{
			carid[count] = i;
			model = GetVehicleModel(i);
			format(str, sizeof(str), "%i: %s \n", count, GetVehicleName(model));
			strcat(carlist, str, sizeof(carlist));
			count++;
		}
	}
	if(count == 1)
	{
		SendClientMessage(playerid, COLOR_GREY, "You dont own any vehicles");
		return 1;
	}
	else
	{
		ShowPlayerDialog(playerid, DIALOG_TRACKVEH, DIALOG_STYLE_LIST, "Track vehicle", carlist, "Track", "Cancel");
	} 
	return 1;
}



Re: Unkown Command - Kaperstone - 08.12.2014

Is it in the OnPlayerCommandText callback ?

recheck your OnPlayerCommandPerformed if you have the callback in your script.


Re: Unkown Command - Blademaster680 - 09.12.2014

Nope using zcmd
All my other commands work except for this one, and I have a feeling its to do with the for loop