SA-MP Forums Archive
GameTextForPlayer. - 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: GameTextForPlayer. (/showthread.php?tid=344664)



GameTextForPlayer. - iGetty - 22.05.2012

pawn Код:
public PickupTimer(playerid)
{
    for(new i = 0; i < MAX_HOUSES; i++)
    {
        if(IsPlayerInRangeOfPoint(playerid, 5.0, Houses[i][HouseExteriorX], Houses[i][HouseExteriorY], Houses[i][HouseExteriorZ]))
        {
            new string[256];
            format(string, sizeof(string), "House %d~n~Price: $%d~n~Name: %s~n~Owner: %s~", i, Houses[i][HousePrice], Houses[i][HouseName], Houses[i][HouseOwner]);
            GameTextForPlayer(playerid, string, 3000, 5);
            return 1;
        }
    }
    return 1;
}
Could anybody tell me what the problem with this is?

It spams my screen with all different ID's of houses and names, then crashes my game?

Thanks!


Re: GameTextForPlayer. - Niko_boy - 22.05.2012

put new string out side of for loop at the top
also ig uess add GameTextForPlayer to bottom above return 1;