question
#1

What does this stock do?

pawn Код:
stock TogglePlayerControllable2(playerid, controllable, freezeid=0) //By Gabriel "Larcius" Cordes
{
    if(IsPlayerConnected(playerid))
    {
        new isplfreeze=IsPlayerFreeze(playerid);
        if (controllable==0)
        {
            if(freezeid>=MAX_FREEZE_ALL || freezeid<0)
            {
                for(new i=0; i<MAX_FREEZE_ALL; i++)
                {
                    Players[playerid][Freeze][i]=0;
                }
                Players[playerid][Freeze][0]=1;
            }
            else
            {
                Players[playerid][Freeze][freezeid]=1;
            }
            if(!isplfreeze)
            {
                TogglePlayerControllable(playerid, 0);
                #if defined OnPlayerToggleControllable
                OnPlayerToggleControllable(playerid, 0);
                #endif
            }
        }
        else
        {
            if(freezeid>=MAX_FREEZE_ALL || freezeid<0)
            {
                for(new i=0; i<MAX_FREEZE_ALL; i++)
                {
                    Players[playerid][Freeze][i]=0;
                }
            }
            else
            {
                Players[playerid][Freeze][freezeid]=0;
            }
            if(isplfreeze && !IsPlayerFreeze(playerid))
            {
                TogglePlayerControllable(playerid, 1);
                #if defined OnPlayerToggleControllable
                OnPlayerToggleControllable(playerid, 1);
                #endif
            }
        }
        return 1;
    }
    return 0;
}
Found in Useful Functions .inc
Reply


Messages In This Thread
question - by fissekarl - 24.04.2011, 07:24
Re: question - by [ADC]Aldi96 - 24.04.2011, 07:39
Re: question - by judothijs - 24.04.2011, 14:05
Re: question - by fissekarl - 24.04.2011, 16:53
Re: question - by CrazyBlob - 24.04.2011, 18:39
Re: question - by [SFA]SpiRRiT - 24.04.2011, 18:48

Forum Jump:


Users browsing this thread: 1 Guest(s)