Not working command
#1

Код:
CMD:pirktihata(playerid, params[])
{
    print("33")
    if( !IsPlayerInRangeOfPoint( playerid, 1, HouseInfo[house][posa][0], HouseInfo[house][posa][1], HouseInfo[house][posa][2] ) )
    print("55")
					continue;
	if( HouseInfo[house][selling] )
    {
    if( GetPVarInt( playerid, "pOHouse2" ) == 0 )
					{
					    print("6")
					   	if( GetPlayerMoney( playerid ) < HouseInfo[house][cost] )
						{
						    print("7")
							SendClientMessage( playerid, WHITE, "[ > ]{FF7E7E} Atsipra?ome, bet jums nepakanka pinigё!" );
							return true;
						}
						print("8")
						HOUSE_BUY_DIALOG( playerid, house );
					}
					print("9")
					else
					    SendClientMessage( playerid, WHITE, "[ > ]{FF7E7E} Atsipra?ome, bet j?s nebegalite tur?ti daugiau namё!" );
			    }
			}
			return true;
	    }
It not working, just nothing when i write it.. With this command u buy a house.
Reply
#2

very badly indented!(might be from coping but..)
if the "print("33")" doesn't work then there are more thing you need to debug.
and do you get any warnings at all ?
returning 1 ?
Reply
#3

By not working you mean? It doesn't print anything? Well, it will not even be compiled with the missing semicolons and the extra closed bracket.

pawn Код:
CMD:pirktihata(playerid, params[])
{
    if (!IsPlayerInRangeOfPoint(playerid, 1, HouseInfo[house][posa][0], HouseInfo[house][posa][1], HouseInfo[house][posa][2])) return SendClientMessage(playerid, -1, "[ > ]{FF7E7E} Not in range!");
    if (HouseInfo[house][selling])
    {
        if (GetPVarInt(playerid, "pOHouse2")) return SendClientMessage(playerid, WHITE, "[ > ]{FF7E7E} Atsipra?ome, bet j?s nebegalite tur?ti daugiau namё!");
        {
            if (GetPlayerMoney(playerid) < HouseInfo[house][cost]) SendClientMessage(playerid, WHITE, "[ > ]{FF7E7E} Atsipra?ome, bet jums nepakanka pinigё!");
            else HOUSE_BUY_DIALOG(playerid, house);
        }
    }
    return 1;
}
@park4bmx: true and 1 is the same thing.
Reply
#4

O_O Haven't seen a code that messy in a while!!!
Reply
#5

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
By not working you mean? It doesn't print anything? Well, it will not even be compiled with the missing semicolons and the extra closed bracket.

pawn Код:
CMD:pirktihata(playerid, params[])
{
    if (!IsPlayerInRangeOfPoint(playerid, 1, HouseInfo[house][posa][0], HouseInfo[house][posa][1], HouseInfo[house][posa][2])) return SendClientMessage(playerid, -1, "[ > ]{FF7E7E} Not in range!");
    if (HouseInfo[house][selling])
    {
        if (GetPVarInt(playerid, "pOHouse2")) return SendClientMessage(playerid, WHITE, "[ > ]{FF7E7E} Atsipra?ome, bet j?s nebegalite tur?ti daugiau namё!");
        {
            if (GetPlayerMoney(playerid) < HouseInfo[house][cost]) SendClientMessage(playerid, WHITE, "[ > ]{FF7E7E} Atsipra?ome, bet jums nepakanka pinigё!");
            else HOUSE_BUY_DIALOG(playerid, house);
        }
    }
    return 1;
}
@park4bmx: true and 1 is the same thing.
Still not working, it say Unknown Command..
Reply
#6

That's probably because the code causes a run time error. The only one I can think of is Array index out of bounds because of the house. It was declared as global and it accesses an invalid index from HouseInfo array.

In order to confirm it, you need to load crashdetect plugin and compile with debug info (-d3). Re-compile the script, run the server and use the command again. If it displays the unknown command, post the server log.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)