[AJUDA] Player deslogar
#1

Olб, como faзo para que quando o player deslogue o objeto seja destruнdo altomaticamente?

pawn Code:
stock DeleteRadio(playerid)
{
    for(new i = 0; i < sizeof(Roadblocks); ++i)
    {
        if(IsPlayerInRangeOfPoint(playerid, 5.0, Roadblocks[i][sX], Roadblocks[i][sY], Roadblocks[i][sZ]))
        {
            if(Roadblocks[i][sCreated] == 1)
            {
                Roadblocks[i][sCreated] = 0;
                Roadblocks[i][sX] = 0.0;
                Roadblocks[i][sY] = 0.0;
                Roadblocks[i][sZ] = 0.0;
                DestroyDynamicObject(Roadblocks[i][sObject]);
                return 0x01;
            }
        }
    }
    return 0;
}
Reply
#2

coloque no OnPlayerDisconect

pawn Code:
DeleteRadio(playerid)
ou entao
pawn Code:
if(Roadblocks[i][sCreated] == 1)
            {
                Roadblocks[i][sCreated] = 0;
                Roadblocks[i][sX] = 0.0;
                Roadblocks[i][sY] = 0.0;
                Roadblocks[i][sZ] = 0.0;
                DestroyDynamicObject(Roadblocks[i][sObject]);
                return 0x01;
            }
Reply
#3

Nossa, vlw +rep
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)