#1

Why NPC logs out after 5sec when I turn on server?

OnPlayerSpawn

pawn Код:
//==================================================== NPC
    if( IsPlayerNPC( playerid ) )
    {
        new
            Vardas[ 24 ]
        ;
        GetPlayerName( playerid, Vardas, 24 );
        if( !strcmp( Vardas, "AutobusoVairuotojas", true ) ) PutPlayerInVehicle( playerid, Autobusas, 0 );
        if( !strcmp( Vardas, "Serifas", true ) ) SetPlayerInterior( playerid, 6 );
        if( !strcmp( Vardas, "Mokytojas", true ) ) SetPlayerInterior( playerid, 3 );
        if( !strcmp( Vardas, "Barmenas", true ) ) SetPlayerInterior( playerid, 18 );
        if( !strcmp( Vardas, "Sekretore", true ) ) SetPlayerInterior( playerid, 3 );
    }
    //==================================================== another shit!
    if( IsPlayerNPC( playerid ) ) return 1;
..

server.cfg

maxnpc 5

Added if( IsPlayerNPC( playerid ) ) return false; in all timers, callbacks. using only one fs - fsdebug, tryied to turn it off, but..

Please, help me
Reply
#2

that is because something letting them out. Did you have password or something
Reply
#3

Код:
if( !strcmp( Vardas, "Serifas", true ) ) SetPlayerInterior( playerid, 6 );
I think its wrong.
Try

Код:
if(strfind(Vardas, "Serifas",true) != -1) SetPlayerInterior(playerid, 6);
or

Код:
if(strcmp(Vardas, "Serifas",true) == 0) SetPlayerInterior(playerid, 6);
Reply
#4

No, server isnt locked. Sasino, it can't be wrong, because all this script is from tut.
Reply
#5

bump. ;<>
Reply
#6

If you have a register/login system, you need to bypass it for npcs,
pawn Код:
LoginCommand()
{
    if(IsPlayerNPC(playerid))
    {
        CodeToByPass
    }
    return 1;
}
Reply
#7

I sayd that checking is added, so I dont think that is bad -.-

pawn Код:
public OnPlayerConnect(playerid)
{
    if( IsPlayerNPC( playerid ) ) return 1;
    TextDrawShowForPlayer( playerid, Puslapis );
    SetPVarInt( playerid, "Prisijunges", 0 );
    new
        Stringas[ 130 ]
    ;
    format( Stringas, 130, ""#h_Balta"[ > ] "#h_Geltona"%s "#h_Zalia"prisijungл prie "#h_Orandzine"Fort Carson gyvenimo.", ZaidejoVardas( playerid ) );
    SendClientMessageToAll( -1, Stringas );
    new
        Failas[ 51 ]
    ;
    format( Failas, 51, "DuomenuBaze/Zaidejai/%s.ini", ZaidejoVardas( playerid ) );
    if( dini_Exists( Failas ) ) ShowPlayerDialog( playerid, 4, DIALOG_STYLE_INPUT, ""#h_Geltona"Prisi"#h_Zalia"jun"#h_Raudona"gimas", ""#h_Balta"Sveiki sugrбюж б "#h_Geltona"Fort Carson "#h_Raudona"Gyvenimа!\n"#h_Balta"Suveskite savo "#h_Orandzine"slaptaюodб ir юaiskite!", "Jungtis", "Palikti" );
    if( !dini_Exists( Failas ) ) ShowPlayerDialog( playerid, 3, DIALOG_STYLE_INPUT, ""#h_Geltona"Re"#h_Zalia"gis"#h_Raudona"tracija", ""#h_Balta"Jыs esate "#h_Zalia"Naujokas. "#h_Orandzine"\nSuveskite slaptaюodб, ir pradлkite юaidimа "#h_Raudona"Fort Carson Gyvenime.", "Vesti", "Palikti" );
    return 1;
}
Reply
#8

Oh, then I really dunno.
Reply
#9

oh wait sorry...

You don't need to change NPC's interior, I believe they're visible in all interiors.
Reply
#10

buumppx

iM: nah, tryied this.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)