Why this script crashs the player?
#1

pawn Код:
switch( random( 2 ))
    {
        case 0:
        {
            ProxDetector( 25.0, playerid, "** The house lock is breached. (( House ))", COLOR_ACTION, COLOR_ACTION, COLOR_ACTION, COLOR_ACTION, COLOR_ACTION );
            HouseInfo[BreakIn[playerid]][hLocked] = 0;
            BreakInTime[playerid] = 0;
           
            KillTimer( PlayerBreakinTimer[playerid] );
            new house = BreakIn[playerid];
            if( HouseInfo[house][hAlarm] != 0)
            {
                ProxDetector( 40.0, playerid, "** BEEP BEEP BEEP BEEP BEEP (( House anti-burglar alarm ))", COLOR_ACTION, COLOR_ACTION, COLOR_ACTION, COLOR_ACTION, COLOR_ACTION );

                new AlertStr[128];
                format( AlertStr, 128, "HQ Dispatch: An house alarm reports of a house burglar! Address %s marked in GPS.", HouseInfo[house][hAddress] );

                foreach(Player, x)
                {
                    if( PlayerInfo[x][FactionMember] == 1 )
                    {
                        SendClientMessage( x, COLOR_BLUE, AlertStr );
                        SetPlayerCheckpoint( x, HouseInfo[house][hx], HouseInfo[house][hy], HouseInfo[house][hz], 10.0);
                        PlayerInfo2[x][CheckpointInfo]=CP_GUIDE;
                    }
                }
               
                new owner = GetPlayerIdFromName( HouseInfo[house][hOwner] );
                if( owner != INVALID_PLAYER_ID && PlayerInfo[owner][JailType] == 0)
                {
                    format( AlertStr, 128, "** BEEP BEEP BEEP BEEP (( %s's remote house alarm ))", GetRPName( owner ));
                    ProxDetector( 25.0, owner, AlertStr, COLOR_ACTION, COLOR_ACTION, COLOR_ACTION, COLOR_ACTION, COLOR_ACTION );
                }
            }
           
            switch( random( 2 ))
            {
                case 0:
                {
                    format( szString, 128, "** Tools have broken for excessive use. (( %s ))", GetRPName( playerid ));
                    ProxDetector( 25.0, playerid, szString, COLOR_ACTION, COLOR_ACTION, COLOR_ACTION, COLOR_ACTION, COLOR_ACTION );
                    PlayerInfo[playerid][BreakKit]=0;
                }
            }
           
            BreakIn[playerid] = -1;
        }

        case 1:
        {
            SendClientMessage( playerid, COLOR_RED, "You failed breaking in the house." );
            BreakIn[playerid] = -1;
            BreakInTime[playerid] = 0;
        }
    }
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)