27.07.2010, 17:20
(
Last edited by [MNC]Azz; 27/07/2010 at 07:34 PM.
)
You must have a ready NPC(to make go to the link below)
https://sampforum.blast.hk/showthread.php?tid=95034
1st:
You must add this above OnGameModeInit
2nd:
Add this line under OnGameModeInit
3rd
Add this line under OnPlayerSpawn
If your NPC is in a vehicle it will look like this :
And thats it! Hope it helped!
Reply if you have any questions...
https://sampforum.blast.hk/showthread.php?tid=95034
1st:
You must add this above OnGameModeInit
Code:
new Text3D:Botinfo;//you can change "Botinfo" to whatever you want
Add this line under OnGameModeInit
Quote:
|
Botinfo = Create3DTextLabel("Bot_name_here",Colour_here,0.0, 0.0,0.0,30.0,0); |
Add this line under OnPlayerSpawn
Code:
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(Botinfo, playerid, 0.0, 0.0, 0.0);
return 1;
}
Code:
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(Botinfo, playerid, 0.0, 0.0, 0.0);
PutPlayerInVehicle(playerid, NRG500, 0); //you must have created a vehicle for it!
return 1;
}
Reply if you have any questions...


