Train Bot Error
#1

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?
Reply
#2

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

try that
Reply
#3

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

without else
Reply
#4

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

PutPlayerInVehicle(playerid, Train, 0);

Is that correct?
Reply
#5

I think yes.
Reply


Forum Jump:


Users browsing this thread: 5 Guest(s)