[AJUDA]alguem possui um npc em ls pronto?
#1

preciso de um fs de npc ja pronto pq na quele posta o meu npc nun pega nunca o cassa faltou expliicaзao mas em fin algue mtem um npc ai ja e o fs?
Reply
#2

pawn Код:
//
// A test driver NPC with very basic AI
// Kye 2009
//

#include <a_npc>

new gStoppedForTraffic = 0;
new gPlaybackActive = 0;

public ScanTimer();

#define AHEAD_OF_CAR_DISTANCE    11.0
#define SCAN_RADIUS              11.0

//------------------------------------------

main(){}

//------------------------------------------

stock GetXYInfrontOfMe(Float:distance, &Float:x, &Float:y)
{
    new Float:z, Float:angle;
    GetMyPos(x,y,z);
    GetMyFacingAngle(angle);
    x += (distance * floatsin(-angle, degrees));
    y += (distance * floatcos(-angle, degrees));
}

//------------------------------------------

public OnNPCModeInit()
{
    SetTimer("ScanTimer",200,1);
}

//------------------------------------------

LookForAReasonToPause()
{
    new Float:X,Float:Y,Float:Z;
    new x=0;
   
    GetMyPos(X,Y,Z);
    GetXYInfrontOfMe(AHEAD_OF_CAR_DISTANCE,X,Y);
   
    while(x!=MAX_PLAYERS) {
        if(IsPlayerConnected(x) && IsPlayerStreamedIn(x)) {
            if( GetPlayerState(x) == PLAYER_STATE_DRIVER ||
                GetPlayerState(x) == PLAYER_STATE_ONFOOT )
            {
                if(IsPlayerInRangeOfPoint(x,SCAN_RADIUS,X,Y,Z)) {
                    return 1;
                }
            }
        }
        x++;
    }
   
    //new msg[256];
    //new Float:angle;
    //GetMyFacingAngle(angle);
    //format(msg,256,"My yaw/heading = %f",angle);
    //SendChat(msg);
   
    return 0;
}


//------------------------------------------

public ScanTimer()
{
    //new ticker = GetTickCount() - g_LastTick;
    //printf("npctest: timer (%d)ms", ticker);
    //g_LastTick = GetTickCount();
   
    new ReasonToPause = LookForAReasonToPause();
   
    if(ReasonToPause && !gStoppedForTraffic)
    {
        //SendChat("I'm pausing");
        PauseRecordingPlayback();
        gStoppedForTraffic = 1;
    }
    else if(!ReasonToPause && gStoppedForTraffic)
    {
        //SendChat("I'm resuming");
        ResumeRecordingPlayback();
        gStoppedForTraffic = 0;
    }
}


//------------------------------------------

StartPlayback()
{
    StartRecordingPlayback(PLAYER_RECORDING_TYPE_DRIVER,"taxi_test_1282");
    gStoppedForTraffic = 0;
    gPlaybackActive = 1;
}
   

//------------------------------------------

public OnRecordingPlaybackEnd()
{
    StartPlayback();
}

//------------------------------------------

public OnNPCEnterVehicle(vehicleid, seatid)
{
    StartPlayback();
}

//------------------------------------------

public OnNPCExitVehicle()
{
    StopRecordingPlayback();
}

//------------------------------------------
so falta o recording
Reply
#3

TA DANDO ERRO
Quote:

C:\Documents and Settings\LUIZ GUSTAVO\Meus documentos\2\filterscripts\XP.pwn(101) : warning 204: symbol is assigned a value that is never used: "gPlaybackActive"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Warning.

Reply
#4

pawn Код:
#pragma unused gPlaybackActive
Reply
#5

@Shickcard: quando acontece isso, й melhor remover a variбvel que nгo se estб a usar do que usar pragma. Pragmas apenas 'dizem' para o compilador ignorar, definifir ou modificar isso e aquilo, mas a variбvel em questгo vai continuar existindo e usando memуria que poderia ser usada para outras coisas.
Reply
#6

Й sу uma forma de driblar o compilador para novatos.

Entra MSN.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)