No errors , no warnings - just not working
#3

You don't need to create a random place, just pick the first empty slot the first loop finds and break the loop in that case.


Try this:
pawn Код:
stock PlaceToHospitalBed(playerid)
{
    new bool: full = true;
    for (new i; i < sizeof (LigoninesLovos); ++i)
    {
        if (LigoninesLovos[i][LL_taken] == false)
        {
            full = false;
            SetPlayerInterior(playerid,3);
            SetPlayerPos(playerid, LigoninesLovos[Random][LL_pos][0], LigoninesLovos[Random][LL_pos][1], LigoninesLovos[Random][LL_pos][2]);
            SetPlayerFacingAngle(playerid, LigoninesLovos[Random][LL_pos][3]);
            ApplyAnimation(playerid,"CRACK","crckdeth2",4.1, 0, 1, 1, 1, 0);
            TogglePlayerSpectating(playerid, 1);
            TogglePlayerControllable(playerid, 0);
            InterpolateCameraPos(playerid, -200.499435, -1758.981567, 677.898132, -200.831359, -1772.208251, 677.901367, 20000);
            InterpolateCameraLookAt(playerid, -198.193222, -1763.108764, 676.270874, -198.342041, -1768.232177, 676.171081, 20000);
            SendClientMessage(playerid, CHATCOLOR_RED, "Siek tiek turesi palaukti kol pagysi!");
            LigoninesLovos[i][LL_taken] = true;
            break;
        }
    }
    if (full)
    {
        SetPlayerPos(playerid,-202.3200,-1761.7898,675.7687);
        SendClientMessage(playerid,CHATCOLOR_RED,"Palatose nera vietu todel buvai greit pagydytas ant operacinio stalo.");
    }
    return 1;
}
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 8 Guest(s)