How do i attach a chat bubble to a bot?
#1

well i put this in the NPC's mode:
Код:
public OnNPCSpawn() StartRecordingPlayback(RECORDING_TYPE, RECORDING); SetPlayerChatBubble(playerid, "Im a tank RAWR!", yellow, 40.0, 0);
but i dont think it works

how would i make the chat bubble text last forever?
Reply
#2

Use 3D text labels.
Reply
#3

it works in fs and gm

get the botid (using getplayername)
and then set the chatbubble in a fs or gm
Reply
#4

Should this work?:

Код:
  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, "rhinobot", true)) //Checking if the NPC's name is MyFirstNPC
    {
      PutPlayerInVehicle(playerid, tank, 0); //Putting the NPC into the vehicle we created for it.
      SetPlayerChatBubble(playerid, "Im a tank RAWR!", yellow, 40.0, -1);
    }
    return 1;
  }
Reply
#5

Quote:
Originally Posted by [mad
MLK (dino-host.net) ]
Should this work?:

Код:
  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, "rhinobot", true)) //Checking if the NPC's name is MyFirstNPC
    {
      PutPlayerInVehicle(playerid, tank, 0); //Putting the NPC into the vehicle we created for it.
      SetPlayerChatBubble(playerid, "Im a tank RAWR!", yellow, 40.0, -1);
    }
    return 1;
  }
i dont know the exact fucntion names
but you can make an 3d text label and attach it to the bot using the attatch function for 3d labels,
search the wiki, just return playerid as the botid using your method
Reply
#6

Why use a 3D Text label when you can use a chat bubble which has better font, can be handled from a single function call, and doesn't require any external timers or anything?
Reply
#7

Quote:
Originally Posted by Jay_
Why use a 3D Text label when you can use a chat bubble which has better font, can be handled from a single function call, and doesn't require any external timers or anything?
Chatbubbles expire... 3DText labels don't...

He wants it to stay on, not disappear.
Reply
#8

hmm i tried 3D label this is how it turned out:

My Code (Under 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, "rhinobot", true)) //Checking if the NPC's name is MyFirstNPC
    {
      PutPlayerInVehicle(playerid, tank, 0); //Putting the NPC into the vehicle we created for it.
      new tanklabel;
      tanklabel = Create3DTextLabel("Im a tank RAWR!!",0x008080FF,0.0,0.0,0.0,0.0,0);
      Attach3DTextLabelToVehicle(tanklabel, tank, 0.0, 0.0, 0.0);
      
    }
    return 1;
  }
Errors:

Код:
C:\Users\user\Desktop\SAMP Server\Everything World\gamemodes\EverythingWorldTwoBeta.pwn(323) : warning 213: tag mismatch
C:\Users\user\Desktop\SAMP Server\Everything World\gamemodes\EverythingWorldTwoBeta.pwn(324) : warning 213: tag mismatch
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Warnings.
Line 323 is the Create3DTextLabel
Reply
#9

new tanklabel;
should be
new PlayerText3D:tanklabel; or new Text3D:tanklabel;
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)