SA-MP Forums Archive
Knock dont works! - 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: Knock dont works! (/showthread.php?tid=303960)



Knock dont works! - lukas567 - 16.12.2011

Hey!

Whats wrong with my code?

Код:
for(new i=0;i<MAX_PLAYERS;i++)
	{
		if(IsPlayerConnected(i))
		{
                         if(GetPlayerInterior(i)==dini_Int(str1, "Interior"))
			{
                         if(IsPlayerInRangeOfPoint(i, 10, dini_Int(str1, "X"), dini_Int(str1, "Y"), dini_Int(str1, "Z")))
			{
				ShadInfoBoxForPlayer(playerid, "Someone is knocking at your door!");
			}
		}
	}
}
This code doesn't works...
No errors, no warnings


Re: Knock dont works! - Jack_Leslie - 16.12.2011

Shouldn't:
pawn Код:
ShadInfoBoxForPlayer(playerid, "Someone is knocking at your door!");
Be:
pawn Код:
ShadInfoBoxForPlayer(i, "Someone is knocking at your door!");
??


Re : Knock dont works! - BigBaws - 16.12.2011

use this
Код:
if(strcmp(cmd, "/knock", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            GetPlayerName(playerid, sendername, sizeof(sendername));
            if(PlayerInfo[playerid][pMaskUse] == 1) { format(sendername, sizeof(sendername), "Stranger_%d", PlayerInfo[playerid][pRandMask]); }
            for(new i = 0; i < sizeof(HouseInfo); i++)
			{
				if (PlayerToPoint(3, playerid,HouseInfo[i][hEntrancex], HouseInfo[i][hEntrancey], HouseInfo[i][hEntrancez]))
				{
                    format(string, sizeof(string), "* %s knocks on a house door.", sendername);
					ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
					foreach (Player,p)
					{
					    if(PlayerToPoint(60, p, HouseInfo[i][hExitx], HouseInfo[i][hExity], HouseInfo[i][hExitz]))
					    {
					        SendClientMessage(p, COLOR_PURPLE, "* Someone knocks on a house door.");
					    }
					}
				}
			}
        }
        return 1;
    }



Re: Knock dont works! - PrawkC - 16.12.2011

There is so much bad in this thread


Re: Knock dont works! - lukas567 - 16.12.2011

Quote:
Originally Posted by Jack_Leslie
Посмотреть сообщение
Shouldn't:
pawn Код:
ShadInfoBoxForPlayer(playerid, "Someone is knocking at your door!");
Be:
pawn Код:
ShadInfoBoxForPlayer(i, "Someone is knocking at your door!");
??
Thanks! It worked! My mistake...

Respect