Buycar command not working
#1

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
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)