NPC names
#2

add this above OnGameModeInit
pawn Код:
new Text3D:NPC;//you can change "NPC" to whatever you want
Add this line under OnGameModeInit
pawn Код:
NPC = Create3DTextLabel("Bot_name_here",Color_here,0.0, 0.0,0.0,30.0,0);
Add this line under OnPlayerSpawn

pawn Код:
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, "NPC_connect_name", true))
    {
      Attach3DTextLabelToPlayer(NPC, playerid, 0.0, 0.0, 0.0);
      return 1;
    }
If your NPC is in a vehicle it will look like this :

pawn Код:
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, "NPC_connect_name", true))
    {
      Attach3DTextLabelToPlayer(NPC, playerid, 0.0, 0.0, 0.0);
      PutPlayerInVehicle(playerid, NRG500, 0); //you must have created a vehicle for it!
      return 1;
    }
here you go
Reply


Messages In This Thread
NPC names - by Blasphemy - 27.09.2012, 04:53
Re: NPC names - by XtremeR - 27.09.2012, 04:59
Re: NPC names - by .v - 27.09.2012, 04:59
Re: NPC names - by Anak - 27.09.2012, 08:59

Forum Jump:


Users browsing this thread: 1 Guest(s)