Connecting a NPCs
#5

I did it, but when I start server,there's a

[npc:join]AT400_LOS_SANTOS has joined the server <0:127.0.0.1>
[npc:join]AT400_LAS_VENTURAS has joined the server <1:127.0.0.1>
[npc:join]AT400_SAN_FIERRO has joined the server <2:127.0.0.1>

but I have trains too and there's no

[npc:join]VLAK_LS has joined the server ....

Maybe because I'm using AddStaticVehicleEx for train, not CreateVehicle?
Why I am using AddStaticVehicleEx? Because when I start server with CreateVehicle (train1 = CreateVehicle(...)) then it write
You can create train only withe AddStaticVehicle/Ex or something like that.

Here's my code:

pawn Code:
new bot1,bot2,bot3,bot4,bot5,bot6;
OnGameModeInit
pawn Code:
ConnectNPC("AT400_LOS_SANTOS","at400_ls");
    ConnectNPC("AT400_LAS_VENTURAS","at400_lv");
    ConnectNPC("AT400_SAN_FIERRO","at400_sf");
    ConnectNPC("VLAK_LS","VLAK_ls");
    ConnectNPC("VLAK_LV","VLAK_lv");
    ConnectNPC("VLAK_SF","VLAK_sf");
   
    bot1 = CreateVehicle(577, 0.0, 0.0, 5.0, 0.0, 3, 3, 5000); // AT400_LOS_SANTOS
    bot2 = CreateVehicle(577, 0.0, 0.0, 5.0, 0.0, 3, 3, 5000); // AT400_LAS_VENTURAS
    bot3 = CreateVehicle(577, 0.0, 0.0, 5.0, 0.0, 3, 3, 5000); // AT400_SAN_FIERRO
    bot4 = AddStaticVehicleEx(538, 0.0, 0.0, 5.0, 0.0, 3, 3, 5000); // VLAK_LS
    bot5 = AddStaticVehicleEx(538, 0.0, 0.0, 5.0, 0.0, 3, 3, 5000); // VLAK_LV
    bot6 = AddStaticVehicleEx(538, 0.0, 0.0, 5.0, 0.0, 3, 3, 5000); // VLAK_SF
OnPlayerSpawn
pawn Code:
if(IsPlayerNPC(playerid))
    {
    new npcname[MAX_PLAYER_NAME];
    GetPlayerName(playerid, npcname, sizeof(npcname));
    if(!strcmp(npcname, "AT400_LOS_SANTOS", true))
    {
      PutPlayerInVehicle(playerid, bot1, 0);
      return 1;
    }
    if(!strcmp(npcname, "AT400_LAS_VENTURAS", true))
    {
      PutPlayerInVehicle(playerid, bot2, 0);
      return 1;
    }
    if(!strcmp(npcname, "AT400_SAN_FIERRO", true))
    {
      PutPlayerInVehicle(playerid, bot3,0);
      return 1;
        }
        if(!strcmp(npcname, "VLAK_LS", true))
    {
      PutPlayerInVehicle(playerid, bot4, 0);
      return 1;
    }
    if(!strcmp(npcname, "VLAK_LV", true))
    {
      PutPlayerInVehicle(playerid, bot5, 0);
      return 1;
    }
    if(!strcmp(npcname, "VLAK_SF", true))
    {
      PutPlayerInVehicle(playerid, bot6,0);
      return 1;
        }
    return 1;
    }
EDIT: I solve the problem when I was writing this post, problem is because npc script doesn't call VLAK_ls , but train_ls (train_lv,train_sf).
Admins can lock this topic!
Reply


Messages In This Thread
Connecting a NPCs - by Luka P. - 17.10.2009, 19:27
Re: Connecting a NPCs - by Correlli - 17.10.2009, 20:34
Re: Connecting a NPCs - by Luka P. - 17.10.2009, 20:37
Re: Connecting a NPCs - by Correlli - 17.10.2009, 20:48
Re: Connecting a NPCs - by Luka P. - 17.10.2009, 21:39
Re: Connecting a NPCs - by michaelw352 - 10.08.2010, 15:05

Forum Jump:


Users browsing this thread: 2 Guest(s)