04.09.2011, 10:04
Quote:
Help please I have two npc's but only one joins and goes into their vehicle.
This is the code Code:
public OnPlayerSpawn(playerid) { if(IsPlayerNPC(playerid)) { if(strcmp(PlayerName(playerid), "[BOT]Dave") == 0) { PutPlayerInVehicle(playerid,NPCBike,0); SetPlayerColor(playerid,COLOR_DARKOLIVEGREEN); SetPlayerSkin(playerid,50); IsSpawned[playerid] =1; print("[NPC SPAWN] Dave as been added."); } return 1; } if(IsPlayerNPC(playerid)) { if(strcmp(PlayerName(playerid), "[BOT]Billy") == 0) { PutPlayerInVehicle(playerid,NPCTram,0); SetPlayerColor(playerid,COLOR_DARKOLIVEGREEN); SetPlayerSkin(playerid,255); IsSpawned[playerid] =1; print("[NPC SPAWN] Billy has been placed in his tram."); } return 1; } |
pawn Code:
public OnPlayerSpawn(playerid)
{
if(IsPlayerNPC(playerid))
{
if(strcmp(PlayerName(playerid), "[BOT]Dave") == 0)
{
PutPlayerInVehicle(playerid,NPCBike,0);
SetPlayerColor(playerid,COLOR_DARKOLIVEGREEN);
SetPlayerSkin(playerid,50);
IsSpawned[playerid] =1;
print("[NPC SPAWN] Dave as been added.");
return 1;
}
if(strcmp(PlayerName(playerid), "[BOT]Billy") == 0)
{
PutPlayerInVehicle(playerid,NPCTram,0);
SetPlayerColor(playerid,COLOR_DARKOLIVEGREEN);
SetPlayerSkin(playerid,255);
IsSpawned[playerid] =1;
print("[NPC SPAWN] Billy has been placed in his tram.");
return 1;
}
return 1;
}