SA-MP Forums Archive
Npc Problem Helpppppppp!!!!! - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Npc Problem Helpppppppp!!!!! (/showthread.php?tid=482498)



Npc Problem Helpppppppp!!!!! - MBilal - 21.12.2013

Hello Every One i see a Tutorial on forums so i try to make Like That But Npc Join Server and After some Miniutes
its Left the Server .i have must Login system + After Login system player have to Chose class what i do now !!help
Код:
new Hunter;
#endif
public OnGameModeInit()
{
    SetTimer("hostname",3000,1);
	ConnectNPC("Hunter","mynpc");
    Hunter = CreateVehicle(425, 0.0, 0.0, 5.0, 0.0, 3, 3, 5000);
}
public OnPlayerSpawn(playerid)
{
	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, "Hunter", true)) //Checking if the NPC's name is MyFirstNPC
    {
      PutPlayerInVehicle(playerid,Hunter , 0); //Putting the NPC into the vehicle we created for it.
    }
    return 1;
  }
}