SA-MP Forums Archive
Buycar command not working - 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: Buycar command not working (/showthread.php?tid=183621)



Buycar command not working - keri - 16.10.2010

Hi. I have a short question. I wrote a simple command for a FS and when i type in /buycar , it says Server: Unknown command. So, here is the script:
Код:
		if(strcmp(cmd, "/buycar", true) == 0)
		{
		    new car = GetPlayerVehicleID(playerid);
		    if(CarInfo[car][cOwned]==0)
		    {
		        if(GetPlayerCash(playerid) >= CarInfo[car][cPrice])
		        {
		        	if(PlayerInfo[playerid][pCar1] == 999)
		        	{
		        	    SendClientMessage(playerid,COLOR_BLUE,"Car1");
		        	    return 1;
		        	}
		        	if(PlayerInfo[playerid][pCar2] == 999)
		        	{
		        	    SendClientMessage(playerid,COLOR_BLUE,"Car2");
						return 1;
		        	}
				}
				else
				{
				format(string,sizeof(string),"[Car Dealership] You don't have $%d",CarInfo[car][cPrice]);
				SendClientMessage(playerid,COLOR_BLUE,string);
				return 1;
				}
		    }
		    else
		    {
		    format(string,sizeof(string),"You can't buy this car. Car owned by: %s",CarInfo[car][cOwner]);
		    SendClientMessage(playerid,COLOR_BLUE,string);
		    return 1;
		    }
		}
If you see something wrong please tell me.
Thanks for help