loose indentation
#2

Quote:
Originally Posted by Kostas'
Посмотреть сообщение
Hey,

I added a NPC on my server, all works fine except that when i compile it, I get a warning.
line(4313) : warning 217: loose indentation. What i forgot to put?
pawn Код:
4300 |public OnPlayerSpawn(playerid)
4301 |{
4302 |  if(IsPlayerNPC(playerid)) //Checks if the player that just spawned is an NPC.
4303 |  {
4304 |    new npcname[MAX_PLAYER_NAME];
4305 |    GetPlayerName(playerid, npcname, sizeof(npcname)); //Getting the NPC's name.
4306 |    if(!strcmp(npcname, "MyFirstNPC", true)) //Checking if the NPC's name is MyFirstNPC
4307 |    {
4308 |      PutPlayerInVehicle(playerid, MyFirstNPCVehicle, 0); //Putting the NPC into the vehicle we created for it.
4309 |      SetPlayerSkin(playerid,141);
4310 |    }
4311 |    return 1;
4312 |  }
4313 |    SetPlayerInterior(playerid,0);
4314 |    SetPlayerRandomSpawn(playerid);
4315 |    GivePlayerWeapon(playerid, 22, 999);
4316 |    GivePlayerWeapon(playerid, 26, 999);
4317 |    GivePlayerWeapon(playerid, 28, 999);
4318 |    GivePlayerMoney(playerid, 50000);
4319 |    return 1;
4320 |}
Kostas, this area:

pawn Код:
4313 |    SetPlayerInterior(playerid,0);
4314 |    SetPlayerRandomSpawn(playerid);
4315 |    GivePlayerWeapon(playerid, 22, 999);
4316 |    GivePlayerWeapon(playerid, 26, 999);
4317 |    GivePlayerWeapon(playerid, 28, 999);
4318 |    GivePlayerMoney(playerid, 50000);
4319 |    return 1;
Is not under that IF you put there so theres no need for a space. also dude dont use space use tabs. its easyer to spot idendation errors like this.

EDIT: actually 2 spaces. there this will do:

pawn Код:
4300 |public OnPlayerSpawn(playerid)
4301 |{
4302 |  if(IsPlayerNPC(playerid)) //Checks if the player that just spawned is an NPC.
4303 |  {
4304 |    new npcname[MAX_PLAYER_NAME];
4305 |    GetPlayerName(playerid, npcname, sizeof(npcname)); //Getting the NPC's name.
4306 |    if(!strcmp(npcname, "MyFirstNPC", true)) //Checking if the NPC's name is MyFirstNPC
4307 |    {
4308 |      PutPlayerInVehicle(playerid, MyFirstNPCVehicle, 0); //Putting the NPC into the vehicle we created for it.
4309 |      SetPlayerSkin(playerid,141);
4310 |    }
4311 |    return 1;
4312 |  }
4313 |  SetPlayerInterior(playerid,0);
4314 |  SetPlayerRandomSpawn(playerid);
4315 |  GivePlayerWeapon(playerid, 22, 999);
4316 |  GivePlayerWeapon(playerid, 26, 999);
4317 |  GivePlayerWeapon(playerid, 28, 999);
4318 |  GivePlayerMoney(playerid, 50000);
4319 |  return 1;
4320 |}
Reply


Messages In This Thread
loose indentation - by Kostas' - 01.10.2011, 11:27
Re: loose indentation - by henry jiggy - 01.10.2011, 11:41
Re: loose indentation - by Kostas' - 01.10.2011, 11:59
Re: loose indentation - by =WoR=G4M3Ov3r - 01.10.2011, 12:02
Re: loose indentation - by [GOD]Dragonster82 - 01.10.2011, 12:07
Re: loose indentation - by Kostas' - 01.10.2011, 12:29
Re: loose indentation - by $India$ - 01.10.2011, 14:14
Re: loose indentation - by Kingunit - 01.10.2011, 14:37
Re: loose indentation - by $India$ - 01.10.2011, 15:15

Forum Jump:


Users browsing this thread: 1 Guest(s)