OnPlayerEnterDynamicCP
#1

Yeah.. I don't know. It doesn't work, and I don't know why.

pawn Код:
public OnPlayerEnterDynamicCP(playerid, checkpointid)
{
    new string[128];
    for(new c = 0; c < sizeof(Houses); c++)
    {
        if (PlayerToPoint(1.4,playerid,Houses[c][EnterX], Houses[c][EnterY], Houses[c][EnterZ]))
        {
            if(Houses[c][Owned] == 0)
            {
                SendClientMessage(playerid, COLOR_GREEN, "Would you like to buy this?");
                format(string, sizeof(string), "Price: $%d", Houses[c][HousePrice]);
                SendClientMessage(playerid, COLOR_GREEN, string);
                SendClientMessage(playerid, COLOR_WHITE, "Available commands: /enter, /ds(hout)");
                SendClientMessage(playerid, COLOR_WHITE, "/buyhouse");
            }
            if(Houses[c][Rentable] == 1)
            {
                new string2[128];
                format(string, sizeof(string), "[Address: %d] You're standing on %s's porch.",c,Houses[c][Owner]);
                SendClientMessage(playerid, COLOR_GREEN, string);
                format(string2, sizeof(string2), "Available commands: /enter, /ds(hout), /rentroom (Price: $%d)", Houses[c][RentCost]);
                SendClientMessage(playerid, COLOR_WHITE, string2);
            }
                format(string, sizeof(string), "[Address: %d] You're standing on %s's porch.",c,Houses[c][Owner]);
                SendClientMessage(playerid, COLOR_GREEN, string);
                SendClientMessage(playerid, COLOR_WHITE, "Available commands: /enter, /ds(hout)");
            }
        }
    }
    return 1;
}
Reply
#2

Bump
Reply
#3

Bumping
Reply
#4

First thing that comes to mind is this.....

pawn Код:
if (PlayerToPoint(1.4,playerid,Houses[c][EnterX], Houses[c][EnterY], Houses[c][EnterZ]))
There is no need to do that it makes more sense to save the checkpointids then loop through them less math same result.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)