Uknown command!
#1

So I just type /sellhouse confirm ingame and it tells me that it's an unknown command to the server ( even if you own a house), Here's the code:

Код:
	if(strcmp(cmd, "/sellhouse", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
            if(PlayerInfo[playerid][pHouseLevel] == 0)
				return SendClientMessage(playerid, COLOR_GREY, "You don't own a house!");
            new level = PlayerInfo[playerid][pHouseLevel];
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
			    format(string, sizeof(string), "If you sell your property, you stand to make $%d.", level*40000);
			    SendClientMessage(playerid, COLOR_GREY, string);
			    SendClientMessage(playerid, COLOR_GREY, "If you're sure you want to sell, type: /sellhouse confirm");
			    return 1;
			}
			if(strcmp(tmp,"confirm",true) == 0)
			{
	            gDestroyVehicle[PlayerInfo[playerid][pHouseCarID]] = 1;
				SetVehicleToRespawn(PlayerInfo[playerid][pHouseCarID]);

	            PlayerInfo[playerid][pHouseX] = 0;
				PlayerInfo[playerid][pHouseY] = 0;
				PlayerInfo[playerid][pHouseZ] = 0;
				PlayerInfo[playerid][pHouseCarModel] = 542;
				PlayerInfo[playerid][pHouseCarFacing] = 0.0;
				PlayerInfo[playerid][pHouseCarID] = 0;
				PlayerInfo[playerid][pHouseCarNitro] = 0;
				PlayerInfo[playerid][pHouseCarPaintJob] = 0;
				PlayerInfo[playerid][pHouseCarColor] = -1;
				PlayerInfo[playerid][pHouseCarColor2] = -1;
				PlayerInfo[playerid][pHouseCarLock] = 0;
				PlayerInfo[playerid][pHouseCarX] = 0;
				PlayerInfo[playerid][pHouseCarY] = 0;
				PlayerInfo[playerid][pHouseCarZ] = 0;
				PlayerInfo[playerid][pHouseLevel] = 0;
				GiveMoney(playerid, (level * 40000));
				GetPlayerName(playerid, sendername, sizeof(sendername));
				format(string, sizeof(string), "You have sold your level %d house for %d", level, level*40000);
				SendClientMessage(playerid, COLOR_GREY, string);
				format(string, sizeof(string), "%s has sold a level %d house for %d", sendername, level, level*40000);
				PayLog(string);
			}
			else
			{
			    SendClientMessage(playerid, COLOR_GREY, "Invalid command.  For more information, type: /sellhouse");
			    return 1;
			}
 		}
    	return 1;
	}
Reply


Messages In This Thread
Uknown command! - by Stanford - 06.04.2013, 11:17
Re: Uknown command! - by HurtLocker - 06.04.2013, 11:24
Re: Uknown command! - by Stanford - 06.04.2013, 11:31
Re: Uknown command! - by Stanford - 06.04.2013, 11:35
Re: Uknown command! - by HurtLocker - 06.04.2013, 11:44
Re: Uknown command! - by HurtLocker - 06.04.2013, 12:04
Re: Uknown command! - by Stanford - 06.04.2013, 18:54
Re: Uknown command! - by Stanford - 06.04.2013, 19:18
Re: Uknown command! - by ]Rafaellos[ - 06.04.2013, 19:25

Forum Jump:


Users browsing this thread: 1 Guest(s)