Multiple bots in 1 FS does not work - 29 warnings, Help :(
#1

Hi all, I have run into a problem and ive been trying to solve it for past 2 hours..

All of my bots work fine as a single filterscript for each but if i try to put them all into a single one It gives 29 warnings and all bots stay at spawn... I hope someone could help me, Thanks!

Here is the code:

Код:
#include <a_samp>

#define FILTERSCRIPT
new npcname;
new MyFirstNPCVehicle1; //Global variable
new MyFirstNPCVehicle2; //Global variable
new MyFirstNPCVehicle3; //Global variable
new MyFirstNPCVehicle4; //Global variable
new MyFirstNPCVehicle5; //Global variable
new MyFirstNPCVehicle6; //Global variable
new MyFirstNPCVehicle7; //Global variable
new MyFirstNPCVehicle8; //Global variable
new MyFirstNPCVehicle9; //Global variable
new MyFirstNPCVehicle10; //Global variable
public OnFilterScriptInit()
{
 print("BK Bots");
  ConnectNPC("amber","bkambu");
  ConnectNPC("pilot","bkaudi");
  ConnectNPC("bkdrift","bkc");
  ConnectNPC("idiot","bkcar");
  ConnectNPC("kamikaze","bkcraz");
  ConnectNPC("kamiz","bkkaz");
  ConnectNPC("kamiz2","bkkaz2");
  ConnectNPC("cruiz","bkzr");
  ConnectNPC("sam","btaxi");
  ConnectNPC("sam2","btaxi2");
 MyFirstNPCVehicle1 = CreateVehicle(416, 0.0, 0.0, 5.0, 0.0, 0, 0, 5000);
 MyFirstNPCVehicle2 = CreateVehicle(487, 0.0, 0.0, 5.0, 0.0, 0, 0, 5000);
 MyFirstNPCVehicle3 = CreateVehicle(562, 0.0, 0.0, 5.0, 0.0, 0, 0, 5000);
 MyFirstNPCVehicle4 = CreateVehicle(412, 0.0, 0.0, 5.0, 0.0, 0, 0, 5000);
 MyFirstNPCVehicle5 = CreateVehicle(553, 0.0, 0.0, 5.0, 0.0, 0, 0, 5000);
 MyFirstNPCVehicle6 = CreateVehicle(432, 0.0, 0.0, 5.0, 0.0, 0, 0, 5000);
 MyFirstNPCVehicle7 = CreateVehicle(432, 0.0, 0.0, 5.0, 0.0, 0, 0, 5000);
 MyFirstNPCVehicle8 = CreateVehicle(477, 0.0, 0.0, 5.0, 0.0, 0, 0, 5000);
 MyFirstNPCVehicle9 = CreateVehicle(420, 0.0, 0.0, 5.0, 0.0, 0, 0, 5000);
 MyFirstNPCVehicle10 = CreateVehicle(420, 0.0, 0.0, 5.0, 0.0, 0, 0, 5000);
	return 1;
}

public OnPlayerSpawn(playerid)
{

  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, "amber", true)) //Checking if the NPC's name is MyFirstNPC
    {
      PutPlayerInVehicle(playerid, MyFirstNPCVehicle1, 0); //Putting the NPC into the vehicle we created for it.
      return 1;
    }
    if(!strcmp(npcname, "pilot", true))
    {
      PutPlayerInVehicle(playerid, MyFirstNPCVehicle2, 0);
      return 1;
    }
    return 1;

    if(!strcmp(npcname, "bkdrift", true))
    {
      PutPlayerInVehicle(playerid, MyFirstNPCVehicle3, 0);
      return 1;
    }
    return 1;
 
    if(!strcmp(npcname, "idiot", true))
    {
      PutPlayerInVehicle(playerid, MyFirstNPCVehicle4, 0);
      return 1;
    }
    return 1;

    if(!strcmp(npcname, "kamikaze", true))
    {
      PutPlayerInVehicle(playerid, MyFirstNPCVehicle5, 0);
      return 1;
    }
    return 1;

    if(!strcmp(npcname, "kamiz", true))
    {
      PutPlayerInVehicle(playerid, MyFirstNPCVehicle6, 0);
      return 1;
    }
    return 1;

   if(!strcmp(npcname, "kamiz2", true))
    {
      PutPlayerInVehicle(playerid, MyFirstNPCVehicle7, 0);
      return 1;
    }
    return 1;

   if(!strcmp(npcname, "cruiz", true))
    {
      PutPlayerInVehicle(playerid, MyFirstNPCVehicle8, 0);
      return 1;
    }
    return 1;

   if(!strcmp(npcname, "sam", true))
    {
      PutPlayerInVehicle(playerid, MyFirstNPCVehicle9, 0);
      return 1;
    }
    return 1;

   if(!strcmp(npcname, "sam2", true))
    {
      PutPlayerInVehicle(playerid, MyFirstNPCVehicle10, 0);
      return 1;
    }
    return 1;
  }
  //Other stuff for normal players goes here!
  return 1;
}
And the Warnings:

Код:
C:\Users\Bogdan K\Desktop\My Stuff\Server\Sa-mp 0.3a server bk bot\filterscripts\bkbots.pwn(20) : warning 217: loose indentation
C:\Users\Bogdan K\Desktop\My Stuff\Server\Sa-mp 0.3a server bk bot\filterscripts\bkbots.pwn(30) : warning 217: loose indentation
C:\Users\Bogdan K\Desktop\My Stuff\Server\Sa-mp 0.3a server bk bot\filterscripts\bkbots.pwn(40) : warning 217: loose indentation
C:\Users\Bogdan K\Desktop\My Stuff\Server\Sa-mp 0.3a server bk bot\filterscripts\bkbots.pwn(48) : warning 219: local variable "npcname" shadows a variable at a preceding level
C:\Users\Bogdan K\Desktop\My Stuff\Server\Sa-mp 0.3a server bk bot\filterscripts\bkbots.pwn(62) : warning 225: unreachable code
C:\Users\Bogdan K\Desktop\My Stuff\Server\Sa-mp 0.3a server bk bot\filterscripts\bkbots.pwn(62) : warning 217: loose indentation
C:\Users\Bogdan K\Desktop\My Stuff\Server\Sa-mp 0.3a server bk bot\filterscripts\bkbots.pwn(67) : warning 217: loose indentation
C:\Users\Bogdan K\Desktop\My Stuff\Server\Sa-mp 0.3a server bk bot\filterscripts\bkbots.pwn(69) : warning 225: unreachable code
C:\Users\Bogdan K\Desktop\My Stuff\Server\Sa-mp 0.3a server bk bot\filterscripts\bkbots.pwn(69) : warning 217: loose indentation
C:\Users\Bogdan K\Desktop\My Stuff\Server\Sa-mp 0.3a server bk bot\filterscripts\bkbots.pwn(74) : warning 217: loose indentation
C:\Users\Bogdan K\Desktop\My Stuff\Server\Sa-mp 0.3a server bk bot\filterscripts\bkbots.pwn(76) : warning 225: unreachable code
C:\Users\Bogdan K\Desktop\My Stuff\Server\Sa-mp 0.3a server bk bot\filterscripts\bkbots.pwn(76) : warning 217: loose indentation
C:\Users\Bogdan K\Desktop\My Stuff\Server\Sa-mp 0.3a server bk bot\filterscripts\bkbots.pwn(81) : warning 217: loose indentation
C:\Users\Bogdan K\Desktop\My Stuff\Server\Sa-mp 0.3a server bk bot\filterscripts\bkbots.pwn(83) : warning 225: unreachable code
C:\Users\Bogdan K\Desktop\My Stuff\Server\Sa-mp 0.3a server bk bot\filterscripts\bkbots.pwn(83) : warning 217: loose indentation
C:\Users\Bogdan K\Desktop\My Stuff\Server\Sa-mp 0.3a server bk bot\filterscripts\bkbots.pwn(88) : warning 217: loose indentation
C:\Users\Bogdan K\Desktop\My Stuff\Server\Sa-mp 0.3a server bk bot\filterscripts\bkbots.pwn(90) : warning 225: unreachable code
C:\Users\Bogdan K\Desktop\My Stuff\Server\Sa-mp 0.3a server bk bot\filterscripts\bkbots.pwn(90) : warning 217: loose indentation
C:\Users\Bogdan K\Desktop\My Stuff\Server\Sa-mp 0.3a server bk bot\filterscripts\bkbots.pwn(95) : warning 217: loose indentation
C:\Users\Bogdan K\Desktop\My Stuff\Server\Sa-mp 0.3a server bk bot\filterscripts\bkbots.pwn(97) : warning 225: unreachable code
C:\Users\Bogdan K\Desktop\My Stuff\Server\Sa-mp 0.3a server bk bot\filterscripts\bkbots.pwn(97) : warning 217: loose indentation
C:\Users\Bogdan K\Desktop\My Stuff\Server\Sa-mp 0.3a server bk bot\filterscripts\bkbots.pwn(102) : warning 217: loose indentation
C:\Users\Bogdan K\Desktop\My Stuff\Server\Sa-mp 0.3a server bk bot\filterscripts\bkbots.pwn(104) : warning 225: unreachable code
C:\Users\Bogdan K\Desktop\My Stuff\Server\Sa-mp 0.3a server bk bot\filterscripts\bkbots.pwn(104) : warning 217: loose indentation
C:\Users\Bogdan K\Desktop\My Stuff\Server\Sa-mp 0.3a server bk bot\filterscripts\bkbots.pwn(109) : warning 217: loose indentation
C:\Users\Bogdan K\Desktop\My Stuff\Server\Sa-mp 0.3a server bk bot\filterscripts\bkbots.pwn(111) : warning 225: unreachable code
C:\Users\Bogdan K\Desktop\My Stuff\Server\Sa-mp 0.3a server bk bot\filterscripts\bkbots.pwn(111) : warning 217: loose indentation
C:\Users\Bogdan K\Desktop\My Stuff\Server\Sa-mp 0.3a server bk bot\filterscripts\bkbots.pwn(116) : warning 217: loose indentation
C:\Users\Bogdan K\Desktop\My Stuff\Server\Sa-mp 0.3a server bk bot\filterscripts\bkbots.pwn(121) : warning 203: symbol is never used: "npcname"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


29 Warnings.
Reply
#2

For loose indentitation, you need to indent your code.

You have
pawn Код:
Funciton(); // and then
                Function(); //
Should be
pawn Код:
Function();
Function();
Or just write #pragma tabsize 0 at top of your code
Reply
#3

Quote:
Originally Posted by Luka™
For loose indentitation, you need to indent your code.

You have
pawn Код:
Funciton(); // and then
                Function(); //
Should be
pawn Код:
Function();
Function();


Or just write #pragma tabsize 0 at top of your code
Thanks, i have added the Pragma however i still have 10 warnings left and the bots are still at spawn:

Код:
C:\Users\Bogdan K\Desktop\My Stuff\Server\Sa-mp 0.3a server bk bot\filterscripts\bkbots.pwn(48) : warning 219: local variable "npcname" shadows a variable at a preceding level
C:\Users\Bogdan K\Desktop\My Stuff\Server\Sa-mp 0.3a server bk bot\filterscripts\bkbots.pwn(62) : warning 225: unreachable code
C:\Users\Bogdan K\Desktop\My Stuff\Server\Sa-mp 0.3a server bk bot\filterscripts\bkbots.pwn(69) : warning 225: unreachable code
C:\Users\Bogdan K\Desktop\My Stuff\Server\Sa-mp 0.3a server bk bot\filterscripts\bkbots.pwn(76) : warning 225: unreachable code
C:\Users\Bogdan K\Desktop\My Stuff\Server\Sa-mp 0.3a server bk bot\filterscripts\bkbots.pwn(83) : warning 225: unreachable code
C:\Users\Bogdan K\Desktop\My Stuff\Server\Sa-mp 0.3a server bk bot\filterscripts\bkbots.pwn(90) : warning 225: unreachable code
C:\Users\Bogdan K\Desktop\My Stuff\Server\Sa-mp 0.3a server bk bot\filterscripts\bkbots.pwn(97) : warning 225: unreachable code
C:\Users\Bogdan K\Desktop\My Stuff\Server\Sa-mp 0.3a server bk bot\filterscripts\bkbots.pwn(104) : warning 225: unreachable code
C:\Users\Bogdan K\Desktop\My Stuff\Server\Sa-mp 0.3a server bk bot\filterscripts\bkbots.pwn(111) : warning 225: unreachable code
C:\Users\Bogdan K\Desktop\My Stuff\Server\Sa-mp 0.3a server bk bot\filterscripts\bkbots.pwn(121) : warning 203: symbol is never used: "npcname"
Reply
#4

Press CTRL+H and in first box write
npcname

and in second

mynpcname

then press ok and then replace all
Reply
#5

Quote:
Originally Posted by Luka™
Press CTRL+H and in first box write
npcname

and in second

mynpcname

then press ok and then replace all
Still same 10 warnings...
Reply
#6

I guess. I don't know how it is on your computer.
Reply
#7

Quote:
Originally Posted by Luka™
I guess. I don't know how it is on your computer.
If you mean the box on the right side of pawno such as A_Npc.inc then yes i have replaced it as you said but it there is still 10 warnings
Reply
#8

Quote:
Originally Posted by Luka™
I guess. I don't know how it is on your computer.
If you mean the box on the right side of pawno such as A_Npc.inc then yes i have replaced it as you said but it there is still 10 warnings
Reply
#9

Quote:
Originally Posted by Luka™
I guess. I don't know how it is on your computer.
Ok, i have replaced everything as you have said, however the warnings are still there... any other ideas?
Reply
#10

Quote:
Originally Posted by Luka™
I guess. I don't know how it is on your computer.
Ok, i have replaced everything as you have said, however the warnings are still there... any other ideas?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)