SA-MP Forums Archive
Train Bot Error - 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)
+--- Thread: Train Bot Error (/showthread.php?tid=396157)



Train Bot Error - UnknownGamer - 29.11.2012

pawn Код:
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.
pawn Код:
#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?


Re: Train Bot Error - azzerking - 29.11.2012

remove the else from the else if and just put if(!strcmp(playername,"Mike",true)).

try that


Re: Train Bot Error - ReVo_ - 29.11.2012

if(!strcmp(playername,"Mike",true))

without else


Re: Train Bot Error - UnknownGamer - 29.11.2012

It says NPC Conencted, but its not in the train?

PutPlayerInVehicle(playerid, Train, 0);

Is that correct?


Re: Train Bot Error - ChristolisTV - 25.03.2015

I think yes.