SA-MP Forums

Go Back   SA-MP Forums > Non-English > Languages > Archive

 
 
Thread Tools Display Modes
Old 07/07/2010, 09:48 AM   #1
Dave001
Little Clucker
 
Join Date: Jul 2010
Posts: 8
Reputation: 0
Question NPC Készítés,help pls

Lenne egy kis gondom az NPC készítéssel.Megnéztem már rengeteg tutorialt és mindent jól csináltam (szerintem).
A rec fájl a helyén a filter script is és a másik amx is.Az NPC connectel fenn is marad viszont csak áll a kezdőhelyen.
A filterscript:
Code:
#include <a_samp>
#include <a_npc>

new Bus;

public OnFilterScriptInit ( )
{
    print ( "BusNPC" );
    ConnectNPC ( "BusNPC", "BusRec" );
    Bus = CreateVehicle(437, 2109.1763, 1503.0453, 32.2887, 82.2873, 0, 1, 60);
    return 1;
}

public OnPlayerSpawn ( playerid )
{
    if ( IsPlayerNPC ( playerid ) )
    {
        new npcname [ MAX_PLAYER_NAME ];
        GetPlayerName ( playerid, npcname, sizeof ( npcname ) );
        if ( !strcmp ( npcname, "BusNPC", true ) )
        {
            PutPlayerInVehicle ( playerid, Bus, 0 );
        }
    }
}

a másik amx:
Code:
#define RECORDING "busz3" 
#define RECORDING_TYPE 1

#include <a_npc> // 

public OnRecordingPlaybackEnd ( )
{
    StartRecordingPlayback ( RECORDING_TYPE, RECORDING );
    return 0;
}

#if RECORDING_TYPE == 1 
    public OnNPCEnterVehicle ( vehicleid, seatid )
    {
        StartRecordingPlayback ( RECORDING_TYPE, RECORDING );
        return 0;
    }
    public OnNPCExitVehicle ( )
    {
        StopRecordingPlayback ( );
        return 0;
    }
#else 
    public OnNPCSpawn ( )
    {
        StartRecordingPlayback ( RECORDING_TYPE, RECORDING );
        return 0;
#endif
Pls, valaki segitsen mert már 2 napja ezzel próbálkozom és sehogyse jön ösze
Dave001 is offline  
Old 07/07/2010, 04:29 PM   #2
csongi
Little Clucker
 
csongi's Avatar
 
Join Date: Oct 2009
Posts: 7
Reputation: 0
Default Re: NPC Készítés,help pls

csá Dave001
próbáld meg így:
Code:
#include <a_samp>
#include <a_npc>

new Bus;

public OnFilterScriptInit ( )
{
    print ( "BusNPC" );
    ConnectNPC ( "BusNPC", "BusRec" );
    Bus = CreateVehicle(437, 2109.1763, 1503.0453, 32.2887, 82.2873, 0, 1, 60);
    return 1;
}

public OnPlayerSpawn ( playerid )
{
    if ( IsPlayerNPC ( playerid ) )
    {
        new npcname [ MAX_PLAYER_NAME ];
        GetPlayerName ( playerid, npcname, sizeof ( npcname ) );
        if ( !strcmp ( npcname, "BusNPC", true ) )
        {
            PutPlayerInVehicle ( playerid, Bus, 0 );
            return 1;
        }
        return 1;
    }
    return 1;
}
"server\npcmodes" könyvártban a "BusRec.pwn" írd át erre
Code:
#define RECORDING "BusNPC" 
#define RECORDING_TYPE 1

#include <a_npc> // 

public OnRecordingPlaybackEnd ( )
{
    StartRecordingPlayback ( RECORDING_TYPE, RECORDING );
    return 0;
}

#if RECORDING_TYPE == 1 
    public OnNPCEnterVehicle ( vehicleid, seatid )
    {
        StartRecordingPlayback ( RECORDING_TYPE, RECORDING );
        return 0;
    }
    public OnNPCExitVehicle ( )
    {
        StopRecordingPlayback ( );
        return 0;
    }
#else 
    public OnNPCSpawn ( )
    {
        StartRecordingPlayback ( RECORDING_TYPE, RECORDING );
        return 0;
#endif
csongi is offline  
Old 07/07/2010, 06:21 PM   #3
csongi
Little Clucker
 
csongi's Avatar
 
Join Date: Oct 2009
Posts: 7
Reputation: 0
Default Re: NPC Készítés,help pls

Bocs rosszul írtam
Code:
CreateVehicle(437, 2109.1763, 1503.0453, 32.2887, 82.2873, 0, 1, 60);
HELYETT
Code:
AddStaticVehicle(437, 2109.1763, 1503.0453, 32.2887, 82.2873, 0, 1);
Pl.: ha belemész a játékba akkor elmented a járművet ahova akarod mind1 hova(mert úgy is odateleportálja az NPC-hez) és azt írod a CreateVehicle helyett, amit lementett a savedpositions.txt-be!
Először nálam sem ment, ugyanez a probléma volt
csongi is offline  
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Tutorial] NPC készítés [RKS]Ricsi Archive 21 26/07/2011 12:38 AM


All times are GMT. The time now is 02:39 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.