Jump to content
  • 0

Problema NPC


TzAkS

Question

Salut..am incercat sa pun un bot la tren..dar cand deschid serveru imi scrie npc:join Tren_sf has joined...dar pe server nu e:))

in server.cfg am pus la maxnpc..deci nush ce are

la public OnGameModeInit() am pus

ConnectNPC("Tren_SF","trensf");

	trensf = AddStaticVehicle(538,-1943.3127,158.0254,27.0006,357.3614,121,50);

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

gXvsYS
Link to comment
Share on other sites

4 answers to this question

Recommended Posts

pui asta if(IsPlayerNPC(playerid)) return 1;

la onplayerconnect , onplayerspawn etc ...

sa ii dea acces npc-ului sa intre si la othertimer si setplayerunjail sa pui

if(IsPlayerConnected(i) && !IsPlayerNPC(i))

in loc de : if(IsPlayerConnected(i))

ca sa nu actioneze timerele pe el(NPC)

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • 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.