NPC not working
#1

Hey, i have one problem, i add npc bot to server, but npc There is no.

pawn Код:
new Caddy1;
pawn Код:
public OnGameModeInit()
{

    // NPCS
    ConnectNPC("Caddy1","caddy1");
   
    Caddy1 =    AddStaticVehicle(457,1402.7024,2816.2568,10.4394,89.0047,13,1);
    return 1;
}
pawn Код:
public OnPlayerSpawn(playerid)
{
  if(!IsPlayerNPC(playerid)) return 0;

    new playername[64];
    GetPlayerName(playerid,playername,64);

    if(!strcmp(playername,"Caddy1",true))
    {
    SetSpawnInfo( playerid, 0, 258, 1958.33, 1343.12, 15.36, 269.15, 2, 1, 0, 0, 0, 0 );
    PutPlayerInVehicle(playerid, Caddy1, 0);
    SetPlayerColor(playerid,0xFFFF00AA);
    }
   
  return 1;
}

server.cfg

[quote]maxnpc 1[/pawn]

npcmodes
added

pawn Код:
caddy.amx caddy1.pwn
pawn Код:
recording
added
caddy1.rec
Reply
#2

Bump
Reply
#3

Код:
public OnPlayerSpawn(playerid)
{
  if(!IsPlayerNPC(playerid))

	new npcname[MAX_PLAYER_NAME]


 	if(!strcmp(npcname,"Caddy1",true)) 
    {

    PutPlayerInVehicle(playerid, Caddy1, 0);
    SetPlayerColor(playerid,0xFFFF00AA);
	}
	
  return 1;
}
try that
Reply
#4

Quote:
Originally Posted by swredder
Код:
public OnPlayerSpawn(playerid)
{
  if(!IsPlayerNPC(playerid))

	new npcname[MAX_PLAYER_NAME]


 	if(!strcmp(npcname,"Caddy1",true)) 
   {

    PutPlayerInVehicle(playerid, Caddy1, 0);
    SetPlayerColor(playerid,0xFFFF00AA);
	}
	
  return 1;
}
try that
Missed a brace
pawn Код:
public OnPlayerSpawn(playerid)
{
  if(!IsPlayerNPC(playerid))
{

    new npcname[MAX_PLAYER_NAME]


    if(!strcmp(npcname,"Caddy1",true))
    {

    PutPlayerInVehicle(playerid, Caddy1, 0);
    SetPlayerColor(playerid,0xFFFF00AA);
    }
}
   
  return 1;
}
Reply
#5

Yes, but now as I start to play then takes me where the NPC and the NPC gives golf machine
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)