SA-MP Forums Archive
Error in script??! - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Error in script??! (/showthread.php?tid=112368)



Error in script??! - DJDhan - 07.12.2009

Hi ok i am writing a code in which i will set a checkpoint in ls railway station and when an npc in a train enters the checkpoint,it will give gametextforall that the train has arrived in ls railway station.But it gives me some error and warnings.

C:\Users\Dhananjay\Desktop\SA MP Windows Server\filterscripts\gl_npcs.pwn(30) : error 017: undefined symbol "playerid"
C:\Users\Dhananjay\Desktop\SA MP Windows Server\filterscripts\gl_npcs.pwn(90) : warning 217: loose indentation
C:\Users\Dhananjay\Desktop\SA MP Windows Server\filterscripts\gl_npcs.pwn(95) : warning 217: loose indentation

Код:
new CheckpointtrainLS[MAX_PLAYERS];

public OnPlayerEnterCheckpoint(playerid)
{  
  if(IsPlayerNPC(playerid))
  {
   if(CheckpointtrainLS[playerid] == 1)
   {
	  GameTextForAll("A train has arrived at Los Santos Railway Station.", 7500, 5);
   }
   return 1;
  }
  else if(!IsPlayerNPC(playerid))
  {
  GameTextForPlayer(playerid,"This Checkpoint is used for trains!", 7500, 5);
  return 0;
  }
  return 1;
}
Help?


Re: Error in script??! - ft941 - 07.12.2009

on top: #pragma tabsize 0


new CheckpointtrainLS[MAX_PLAYERS];

public OnPlayerEnterCheckpoint(playerid)
{
if(IsPlayerNPC(playerid))
{
if(CheckpointtrainLS[playerid] == 1)
{
GameTextForAll("A train has arrived at Los Santos Railway Station.", 7500, 5);
}
return 1;
}
else if(!IsPlayerNPC(playerid))
{
GameTextForPlayer(playerid,"This Checkpoint is used for trains!", 7500, 5);
return 0;
}
return 1;
}



were is the line 30?


Re: Error in script??! - DJDhan - 07.12.2009

never mind dude i got it working.
I put setplayer checkpoint on player spawn and it works.

Now how to create multiple checkpoints at the other two railways stations?