SA-MP Forums Archive
How do i attach a chat bubble to a bot? - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: How do i attach a chat bubble to a bot? (/showthread.php?tid=100248)



How do i attach a chat bubble to a bot? - [mad]MLK - 03.10.2009

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?


Re: How do i attach a chat bubble to a bot? - Danny_Costelo - 03.10.2009

Use 3D text labels.


Re: How do i attach a chat bubble to a bot? - d0 - 03.10.2009

it works in fs and gm

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


Re: How do i attach a chat bubble to a bot? - [mad]MLK - 03.10.2009

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;
  }



Re: How do i attach a chat bubble to a bot? - rensfromrpas - 03.10.2009

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


Re: How do i attach a chat bubble to a bot? - Jay_ - 03.10.2009

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?


Re: How do i attach a chat bubble to a bot? - Sew_Sumi - 03.10.2009

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.


Re: How do i attach a chat bubble to a bot? - [mad]MLK - 04.10.2009

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


Re: How do i attach a chat bubble to a bot? - Gappy - 04.10.2009

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