PDA

View Full Version : Train Bot Error


UnknownGamer
29/11/2012, 03:13 PM
C:\Users\matt\Desktop\New folder (3)\filterscripts\meganpcpack.pwn(19) : error 029: invalid expression, assumed zero
C:\Users\matt\Desktop\New folder (3)\filterscripts\meganpcpack.pwn(19) : warning 215: expression has no effect
C:\Users\matt\Desktop\New folder (3)\filterscripts\meganpcpack.pwn(19) : error 001: expected token: ";", but found "if"
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


2 Errors.



#include <a_samp>
#include <a_npc>

new Train;

public OnGameModeInit()
{
ConnectNPC("Mike","trainbot");
Train = AddStaticVehicle(449, 2109.1763, 1503.0453, 32.2887, 82.2873, 0, 1);
}

public OnPlayerSpawn(playerid)
{
if(!IsPlayerNPC(playerid)) return 0;

new playername[64];
GetPlayerName(playerid,playername,64);

else if(!strcmp(playername,"Mike",true))
{
PutPlayerInVehicle(playerid, Train, 0);
}
return 1;
}


Anybody spot the error?

azzerking
29/11/2012, 03:22 PM
remove the else from the else if and just put if(!strcmp(playername,"Mike",true)).

try that :D

ReVo_
29/11/2012, 03:30 PM
if(!strcmp(playername,"Mike",true))

without else

UnknownGamer
29/11/2012, 03:52 PM
It says NPC Conencted, but its not in the train?

PutPlayerInVehicle(playerid, Train, 0);

Is that correct?

ChristolisTV
25/03/2015, 01:28 PM
I think yes.