RNPC | Benötige Hilfe

Wichtiger Hinweis: Bitte ändert nicht manuell die Schriftfarbe auf schwarz sondern belasst es bei der Standardeinstellung. Somit tragt ihr dazu bei dass euer Text auch bei Verwendung unseren dunklen Forenstils noch lesbar ist!

Tipp: Ihr wollt längere Codeausschnitte oder Logfiles bereitstellen? Benutzt unseren eigenen PasteBin-Dienst Link
  • Hallo, ich versuche mich grade an dem RNPC Plugin und komme nicht weiter...


    Ich weise dem Bot einen Skin und eine Pos zu aber Sie wird nicht angewendet
    public OnFilterScriptInit()
    {
    BOT_tut1 = CreateRNPC("BOT_tut1");
    SetRNPCSkin(BOT_tut1, 18);
    SetRNPCPos(BOT_tut1, 496.7390, -1872.4899, 4.6770);
    return 1;
    }


    Ich hoffe es kennt sich wer damit aus :D

  • H4rd_B4se:
    Habe ich jetzt im GM und im FS gemacht, aber er Spawnt immer noch nicht richtig X(


    FS
    public OnPlayerRequestClass(playerid, classid)
    {
    if(IsPlayerRNPC(playerid)) return 1;
    return 1;
    }


    public OnPlayerConnect(playerid)
    {
    if(IsPlayerRNPC(playerid)) return 1;
    return 1;
    }


    public OnPlayerDisconnect(playerid, reason)
    {
    if(IsPlayerRNPC(playerid)) return 1;
    return 1;
    }


    GM
    public OnPlayerRequestClass(playerid, classid)
    {
    if(IsPlayerRNPC(playerid)) return 1;
    //if(IsPlayerNPC(playerid)) return 1;
    for(new i = 0; i != 32; i++) SendClientMessage(playerid, -1, " ");
    SpawnPlayer(playerid);
    StepSpawnPlayer[playerid] = 1;
    return 1;
    }


    public OnPlayerConnect(playerid)
    {
    if(IsPlayerRNPC(playerid)) return 1;
    /* ========== NPC BOT ABFRAGE ========== */
    if (IsPlayerNPC(playerid)) return 1;
    new vzMessage[128];


    format(vzMessage, sizeof(vzMessage), "Welcome to "SERVER_NAME", %s", GetPlayerNameEx(playerid));
    SendClientMessage(playerid, -1, vzMessage);
    SetTimerEx("OnPlayerConnected", 750, false, "i", playerid);


    /* REMOVE BUILDINGS */
    //RIESENRAD
    RemoveBuildingForPlayer(playerid, 6463, 389.7734, -2028.4688, 19.8047, 0.5);
    RemoveBuildingForPlayer(playerid, 3751, 389.8750, -2035.3828, 29.9531, 50);
    RemoveBuildingForPlayer(playerid, 6298, 389.7734, -2028.4688, 19.8047, 0.5);
    RemoveBuildingForPlayer(playerid, 6461, 389.7734, -2028.5000, 20.1094, 0.5);
    RemoveBuildingForPlayer(playerid, 3752, 389.8750, -2028.5000, 32.2266, 50);

    //CreatePlayerTextDraws(playerid);

    for(new idx=0; idx<4; idx++){
    PlayerTextDrawDestroy(playerid,ReasonDead[playerid][idx]);
    }


    ... (Textdraws)
    return 1;
    }


    public OnPlayerDisconnect(playerid, reason)
    {
    if(IsPlayerRNPC(playerid)) return 1;
    if (IsPlayerNPC(playerid)) return 1;
    SaveAccount(playerid);
    PlayerLastClick[playerid] = 0;
    Current_MENU[playerid] = -1;
    HUDTIMER[playerid] = -1;
    return 1;
    }


    public OnPlayerConnected(playerid)
    {
    if(IsPlayerRNPC(playerid)) return 1;
    //if(IsPlayerNPC(playerid)) return 1;
    if(IsPlayerConnected(playerid)) {


    SetPlayerCameraPos(playerid,2211.1460,-1748.3909,29.3744);
    SetPlayerCameraLookAt(playerid,2229.4968,-1722.0701,13.5625);
    SetPlayerVirtualWorld(playerid, 0);
    SetPlayerInterior(playerid, 0);
    SetPlayerPos(playerid, 2221.6460, -1733.3965, 13.3983);


    new vzString[128],
    DBResult:dbresult;


    format(vzString, sizeof(vzString), "SELECT NAME FROM `USERS` WHERE `NAME`='%s'", GetPlayerNameEx(playerid));
    dbresult = db_query(users, vzString);
    if(db_num_rows(dbresult) > 0) {
    ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "GTA ONLINE Authentication", "Welcome to GTA ONLINE\nThis account is currently registered, please enter your password to login:", "Login", "Quit");
    }else{
    ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, "GTA ONLINE Registration", "Welcome to GTA ONLINE\nThis account is available for registration, please enter a password to register this account:", "Register", "Quit");
    }
    db_free_result(dbresult);
    }
    return 1;
    }


    public OnPlayerSpawn(playerid)
    {
    if(IsPlayerRNPC(playerid)) return 1;
    if (IsPlayerNPC(playerid)) return 1;
    /*if (IsPlayerNPC(playerid))
    {
    new botname[MAX_PLAYER_NAME];
    GetPlayerName(playerid, botname, sizeof(botname));
    if(!strcmp(botname, "lifecoast_tut_run", true))
    {
    SetPlayerSkin(playerid, 18); // <- The Skin here!
    }
    }*/
    //IntroStart(playerid);
    for(new idx=0; idx<4; idx++){
    PlayerTextDrawHide(playerid,ReasonDead[playerid][idx]);
    }
    //SetPlayerPos(playerid, 2221.6460, -1733.3965, 13.3983);
    return 1;
    }

  • Spawnen musst du ihn noch. Bei OnPlayerRequestClass statt dem return 1 ein
    return SpawnPlayer(playerid);


    /edit
    Sorry mein Fehler ^^
    Setzt den Skin und Posi beim Spawn und nicht beim Filterscriptinit


    Bei OnPlayerSpawn:
    if(IsPlayerRNPC(playerid)) {
    SetPlayerSkin(playerid, 18);
    SetPlayerPos(playerid, .....);
    return 1;
    }
    Das von oben gilt nach wie vor

  • do.de - Domain-Offensive - Domains für alle und zu super Preisen
  • H4rd_B4se:
    huch ^^
    nunja, nun gibt es keine Fehler, dafür verläst der Bot jetzt den Server 8| (0:0)


    #define RECORDING "lifecoast_tut_run"
    #define RECORDING_TYPE 2


    #include <a_npc>
    main(){}
    public OnRecordingPlaybackEnd() StartRecordingPlayback(RECORDING_TYPE, RECORDING);


    #if RECORDING_TYPE == 1
    public OnNPCEnterVehicle(vehicleid, seatid) StartRecordingPlayback(RECORDING_TYPE, RECORDING);
    public OnNPCExitVehicle() StopRecordingPlayback();
    #else
    public OnNPCSpawn() StartRecordingPlayback(RECORDING_TYPE, RECORDING);
    #endif