Jump to content

[0.3] Cum sa adaugi un NPC


cmg4life

Recommended Posts

  • Replies 111
  • Created
  • Last Reply

Top Posters In This Topic

La public OnPlayerSpawn()

if(IsPlayerNPC(playerid)) //Checks if the player that just spawned is an NPC.

    {

    new npcname[MAX_PLAYER_NAME];

    GetPlayerName(playerid, npcname, sizeof(npcname)); //Getting the NPC's name.

    if(!strcmp(npcname, "Art", true)) //Checking if the NPC's name is MyFirstNPC

    {

pune asta->SpawnPlayer(playerid);

    }

    return 1;

    }

mersi mar1an :) merg acuma sa incerc , tot cautam asemena tut dar nu gaseam:P

metallica-logo.jpg
Link to comment
Share on other sites

  • 1 month later...
  • 2 weeks later...
  • 3 weeks later...

Salutare!

Folosesc un gamemode godfather si nu stiu cum sa fac npc-ul sa treaca de pasii cu register/login sa se logheze direct pe server si sa inceapa inregistrarea!

Daca stie cineva si ma poate ajuta il rog sa posteze urgent.

Dupa { de la OnPlayerConnect, OnPlayerSpawn, OnPlayerRequestClass si OnPlayerRequestClass pui asta:

[pawn]if( IsPlayerNPC(playerid) ) return 1;[/pawn]

Link to comment
Share on other sites

stuntman-=!!" post="72278" timestamp="1305451617"]

Dupa { de la OnPlayerConnect, OnPlayerSpawn, OnPlayerRequestClass si OnPlayerRequestClass pui asta:

[pawn]if( IsPlayerNPC(playerid) ) return 1;[/pawn]

Acuma zici...asta trebuia s-o vad în tutorial, dar nu apare -_-"

Dupa atata timp, merge si mie !!  :angry:

;x

Link to comment
Share on other sites

  • 2 weeks later...

Frate chiar am nevoie de el  :cry: dar imi e ff lene sa urmaresc toti pasi aia  :undecided:

Ca vreau sa fac Bus-uri si Tren-uri

~ Admin House Ranch 1~ http://www.sa-mp.ro/forum/index.php/topic,12468.0.html

~ Casa Admin Ranch 2 ~ http://www.sa-mp.ro/forum/index.php/topic,12530.0.html

Link to comment
Share on other sites

  • 2 weeks later...
  • 2 weeks later...
  • 2 weeks later...

Jur ca am facut totul ca in tutorial :|

Npc-ul se conteazeaza pe server

Dar este undeva pe camp si normal ar trebui sa se plimbe cu autobuzul

autobuzul este la locul lui iar npc-ul nu este in el

Uitati script-ul

#include <a_samp>
#include <a_npc>
new NPCBus1;



public OnFilterScriptInit()
{
   NPCBus1 = CreateVehicle(431,1776.3656,-1928.5721,13.4867,0.2502,1,0, 5000);
   ConnectNPC("buz1","buz1");
   return 1;
}

public OnPlayerSpawn(playerid)
{
    if(IsPlayerNPC(playerid)) //Verifica daca playerul este NPC
    {
        new npcname[MAX_PLAYER_NAME];
        GetPlayerName(playerid, npcname, sizeof(npcname)); //Luam numele NPCului
        if(!strcmp(npcname, "buz1", true)) //Verificam daca numele NPCului este "NUME"
        {
            PutPlayerInVehicle(playerid, NPCBus1, 0); //Punem NPCul in vehicul
        }
        return 1;
    }
    return 1;
}

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

De ce nu il pune in autobuz sa se plimbe cu el ?

Link to comment
Share on other sites

  • 2 weeks later...
  • 1 month later...
  • 1 month later...

Bun tutorialul, GJ.

Nu mi se pare normal, sa iti pui 20 npc, ca sa ai playeri. :))

Stiu eu un server care face asta. Nu spun numele.

Acele servere care au 500/500 si nu sunt playeri reali, sau 30/50, sau ceva de genul, nu sunt NPC, NPC-ii scad sloturile serverului, nu aduna numarul de jucatori. Acela este un plugin interzis de SA:MP, de Kalcor, este "server memory hacking plugin" .
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.