27.09.2012, 04:59
add this above OnGameModeInit
Add this line under OnGameModeInit
Add this line under OnPlayerSpawn
If your NPC is in a vehicle it will look like this :
here you go
pawn Код:
new Text3D:NPC;//you can change "NPC" to whatever you want
pawn Код:
NPC = Create3DTextLabel("Bot_name_here",Color_here,0.0, 0.0,0.0,30.0,0);
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;
}
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;
}