Knock dont works!
#1

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
Reply
#2

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

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;
    }
Reply
#4

There is so much bad in this thread
Reply
#5

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)