Many commands throwing SERVER: Unknown command.
#1

Hey guys..

Why server is telling me that the command is unknown... It happens to almost all commands which doesnt need some input text after command.

Example:

Код:
command(renthouse, playerid, params[]) {
	new i = IsPlayerNearHouse(playerid);
	if(HouseData[i][hRentable] == FALSE) return SendClientMessage(playerid, COLOR_SYSTEM, "[Error]: This house is not rentable.");
	if(GetPlayerCash(playerid) >= HouseData[i][hRentPrice]) {
 		GivePlayerCash(playerid, -HouseData[i][hRentPrice]);
   		HouseData[i][hRent] += HouseData[i][hRentPrice];
     	AccountData[playerid][Renting] = i;
      	SendClientMessage(playerid, COLOR_SYSTEM, "[Notice]: You're now renting this house. You can now /lock");
	}
	return 1;
}
It's zcmd. It shows unknown command also for command like /buyhouse /sellhouse /renthouse, but /rentprice works well. Why?
Reply
#2

You need to check if ' i ' is in range 0-sizeof(HouseData)
Reply
#3

Ahh, thanks man. Found my problem. +REP.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)