מציג תוצאות 1 עד 5 מתוך 5

אשכול: יצירת בוט זמין בשרת

  1. #1
    o F i R o F i R מנותק משתמש חסום
    תאריך הצטרפות
    22/10/08
    שם פרטי
    אופיר
    הודעות
    3,853
    קיבל לייק
    0 פעמים

    יצירת בוט זמין בשרת

    קוד:
    http://forum.sa-mp.com/index.php?topic=119947.0
    בגרסה SAMP0.3 הוסיפו אפשרות מדהימה: אפשרות להקליט שחקן נוסע במכונית,הולך,אפשר לשנות לו ניק,לשלוט עליו מתי הוא יעשה את ההקלטה ועוד.

    אז איך אתה תוכל ליצור בוט?:
    פקודות:
    Recording a playback file
    /vrecord <filename> - Starts recording a vehicle path to the specified filename.
    /ofrecord <filename> - Starts recording an on foot path to the specified filename.
    /stoprecord - Stops recording both vehicle and on foot paths.
    /vrecord להקליט בוט בתוך רכב,תכנס לרכב ותעשה את הפקודה [לא לשכוח לרשום שם לקובץ הקלטה]
    /ofrecord להקליט בוט הולך לא במכונית אותו דבר לקבוע שם להקלטה
    /STOPRECORD כמו שנשמע:לעצור את ההקלטה

    אז זה הכל בפקודות,עכשיו הFILTERSCRIPT והNCPMODE

    קודם כל חובה לNPC[בוט] קבצי שרת SAMP03
    כנסו לתיקייה npcmodes
    צרו שם קובץ פאון חדש אם איזה שם שאתם רוצים ובתוך תרשמו ככה:
    PHP Code:
    #define RECORDING "mynpc" //This is the filename of your recording without the extension.
    #define RECORDING_TYPE 1 //1 for in vehicle and 2 for on foot.

    #include <a_npc>
    main(){}
    public 
    OnRecordingPlaybackEnd() StartRecordingPlayback(RECORDING_TYPERECORDING);

    #if RECORDING_TYPE == 1
        
    public OnNPCEnterVehicle(vehicleidseatidStartRecordingPlayback(RECORDING_TYPERECORDING);
        public 
    OnNPCExitVehicle() StopRecordingPlayback();
    #else
        
    public OnNPCSpawn() StartRecordingPlayback(RECORDING_TYPERECORDING);
    #endif 
    בהכל לא נוגעים
    רק בdefile בראשון בRECORDING
    משנים את הMYNPC לשם של הבוט שלכם
    RECORDING_TYPE להגדיר 1=בוט במכונית 2=איש הולך לא ברכב..
    בסדר?
    תשמרו את הפאון ונמשיך,איך שבאלכם או להשים את הבוט כfilterscript או במוד שלכם
    "Dave" - The first parameter is the NPC's name. With this you can detect different NPCs, and perform different actions to them.
    "mynpc" - This is the filename (without extension) of the "mini" script we created above.
    PHP Code:
    ConnectNPC("Dave","mynpc"); 
    FILTERSCRIPT:
    PHP Code:
    new MyFirstNPCVehicle//Global variable!
    public OnFilterScriptInit()
    {
        print(
    "my filterscript");
        
    ConnectNPC("MyFirstNPC","mynpc");
        
    MyFirstNPCVehicle CreateVehicle(4000.00.05.00.0335000);
        return 
    1;

    בזה ^^ תשנו את האיידי של האוטו לאוטו שהקלטתם לא צריך XYZ

    CONNECTNPC הסברתי למעלה..

    PHP Code:
    public OnPlayerSpawn(playerid)
    {
        if(
    IsPlayerNPC(playerid)) //Checks if the player that just spawned is an NPC.
        
    {
            new 
    npcname[MAX_PLAYER_NAME];
            
    GetPlayerName(playeridnpcnamesizeof(npcname)); //Getting the NPC's name.
            
    if(!strcmp(npcname"MyFirstNPC"true)) //Checking if the NPC's name is MyFirstNPC
            
    {
                
    PutPlayerInVehicle(playeridMyFirstNPCVehicle0); //Putting the NPC into the vehicle we created for it.
            
    }
            return 
    1;
        }
        
    //Other stuff for normal players goes here!
        
    return 1;

    להגדיר שם את השם של הבוט במקום MYFIRSTNPC

    למוד אותו דבר רק במקום
    PHP Code:
    new MyFirstNPCVehicle//Global variable!
    public OnGameModeInit()
    {
        print(
    "my gamemode");
        
    ConnectNPC("MyFirstNPC","mynpc");
        
    MyFirstNPCVehicle CreateVehicle(4000.00.05.00.0335000);
        return 
    1;

    PHP Code:
    public OnFilterScriptInit()
    {
        print(
    "my filterscript");
        
    ConnectNPC("MyFirstNPC","mynpc");
        return 
    1;




    ניסיתם ולא עובד?
    Common problems

    My NPC leaves my server after it joins
    Your script is forcing the NPC to login, or you have an anti-cheat / ping kicker that is interfering with your NPC. You can add...

    PAWN Code:
    if(IsPlayerNPC(playerid)) return 1;

    ... as the first line of any callbacks that bots will use, e.g. OnPlayerRequestClass or OnPlayerRequestSpawn. For an efficient, simple way of excluding NPCs from loops, check out foreach by Y_Less.

    My NPC doesn't join my server at all
    This is most likely caused by your server being passworded.

    I can't get the npc_record filterscript to load
    You either don't have the filterscript, or it is already loaded. Try continuing anyway.

    My NPC just stands at the spawnpoint
    Go back, and re-do the OnPlayerSpawn part of the tutorial.

    My NPCs used to connect, but now I have upgraded to >= RC5 they don't.
    There is a new maxnpc server.cfg variable that defaults to 0. add...

    Code:
    maxnpc number_goes_here
    ...to your server.cfg to fix this issue.
    זהו תהנו!

  2. #2
    _IdaN_ _IdaN_ מנותק משתמש חסום
    תאריך הצטרפות
    30/05/09
    שם פרטי
    עידן
    הודעות
    568
    קיבל לייק
    0 פעמים
    פשש תודה אחי אחלה מדריך

    אצלנו יש הרבה כבר תודה אחי
    נערך בפעם האחרונה על ידי _IdaN_ : 10/01/10 ב 19:48

  3. #3
    DR.BLAH DR.BLAH מנותק ג'וניור
    תאריך הצטרפות
    23/08/09
    שם פרטי
    dan
    הודעות
    460
    קיבל לייק
    0 פעמים
    לא הבנתי מזה אבל הבנתי שזה משהו NPC שזה זכור לי ממייפל אז קיצר זה יהיה בשרת הארפי?

  4. #4
    o F i R o F i R מנותק משתמש חסום
    תאריך הצטרפות
    22/10/08
    שם פרטי
    אופיר
    הודעות
    3,853
    קיבל לייק
    0 פעמים
    בהחלט כן!

  5. #5
    QHK QHK מנותק ג'וניור
    תאריך הצטרפות
    30/12/09
    שם פרטי
    אילן
    הודעות
    200
    קיבל לייק
    0 פעמים
    תודה

נושאים דומים

  1. תגובות: 19
    הודעה אחרונה: 26/12/05, 16:50
  2. למשועממים!!דברו עם בוט אייסיקיו
    על ידי B1sHGaDa בפורום תוכנות מסרים
    תגובות: 3
    הודעה אחרונה: 07/11/05, 12:07
  3. בעייהה בשרת ביתי
    על ידי KrT בפורום Tactical Ops
    תגובות: 7
    הודעה אחרונה: 17/10/05, 00:55
  4. תומר בוט
    על ידי BaJo/ShortY בפורום Tactical Ops
    תגובות: 43
    הודעה אחרונה: 15/10/05, 12:48
eXTReMe Tracker