SA-MP Forums Archive
Not working command - 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)
+--- Thread: Not working command (/showthread.php?tid=491913)



Not working command - DovIIs - 01.02.2014

Код:
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.


Re: Not working command - park4bmx - 01.02.2014

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 ?


Re: Not working command - Konstantinos - 01.02.2014

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.


Re: Not working command - SwisherSweet - 01.02.2014

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


Re: Not working command - DovIIs - 01.02.2014

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..


Re: Not working command - Konstantinos - 01.02.2014

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.