27.09.2012, 04:53
How to show a NPC name like normal players ingame?
Is there a function or a way to do it?
Thanks
Is there a function or a way to do it?
Thanks
new Text3D:NPC;//you can change "NPC" to whatever you want
NPC = Create3DTextLabel("Bot_name_here",Color_here,0.0, 0.0,0.0,30.0,0);
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(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;
}
if(IsPlayerNPC(playerid))
{
new npcname[MAX_PLAYER_NAME];
GetPlayerName(playerid, npcname, sizeof(npcname));
if(!strcmp(npcname, "YOURBOTNAME", true))
{
SetPlayerSkin(playerid, 45);
}