20.01.2011, 19:17
I can't understand why npc log out when server gets on?
maxnpc 5
all .rec, .pwn added - yes.
OnGameModeInit
OnPlayerSpawn
And yes, I added isplayernpc checking at: OnPlayerRequestSpawn, OnPlayerConnect, At all anticheats/timers, OnPlayerRequestClass.
Quote:
[22:18:36] Number of vehicle models: 10 [22:18:36] Incoming connection: 127.0.0.1:4128 [22:18:36] [npc:join] Serifas has joined the server (0:127.0.0.1) [22:18:36] Incoming connection: 127.0.0.1:4131 [22:18:36] [npc:join] Mokytojas has joined the server (1:127.0.0.1) [22:18:36] Incoming connection: 127.0.0.1:4130 [22:18:36] [npc:join] AutobusoVairuotojas has joined the server (2:127.0.0.1) [22:18:36] Incoming connection: 127.0.0.1:4129 [22:18:36] [npc:join] Sekretore has joined the server (3:127.0.0.1) [22:18:36] Incoming connection: 127.0.0.1:4132 [22:18:36] [npc:join] Barmenas has joined the server (4:127.0.0.1) [22:18:47] [npcart] Serifas has left the server (0:0) [22:18:47] [npcart] Mokytojas has left the server (1:0) [22:18:47] [npcart] Sekretore has left the server (3:0) [22:18:47] [npcart] Barmenas has left the server (4:0) [22:18:48] [npcart] AutobusoVairuotojas has left the server (2:0) |
all .rec, .pwn added - yes.
OnGameModeInit
pawn Код:
ConnectNPC( "AutobusoVairuotojas", "Autobusas" );
ConnectNPC( "Sekretore", "Vyriausybe" );
ConnectNPC( "Serifas", "Policija" );
ConnectNPC( "Mokytojas", "Mokykla" );
ConnectNPC( "Barmenas", "Baras" );
pawn Код:
if( IsPlayerNPC( playerid ) )
{
if( !strcmp( ZaidejoVardas( playerid ), "AutobusoVairuotojas", true ) )
{
Attach3DTextLabelToPlayer( NPCTekstas, playerid, 0.0, 0.0, 0.0 );
PutPlayerInVehicle( playerid, Autobusas, 0 );
}
if( !strcmp( ZaidejoVardas( playerid ), "Serifas", true ) ) SetPlayerInterior( playerid, 6 ), Attach3DTextLabelToPlayer( NPCTekstas, playerid, 0.0, 0.0, 0.0 );
if( !strcmp( ZaidejoVardas( playerid ), "Mokytojas", true ) ) SetPlayerInterior( playerid, 3 ), Attach3DTextLabelToPlayer( NPCTekstas, playerid, 0.0, 0.0, 0.0 );
if( !strcmp( ZaidejoVardas( playerid ), "Barmenas", true ) ) SetPlayerInterior( playerid, 18 ), Attach3DTextLabelToPlayer( NPCTekstas, playerid, 0.0, 0.0, 0.0 );
if( !strcmp( ZaidejoVardas( playerid ), "Sekretore", true ) ) SetPlayerInterior( playerid, 3 ), Attach3DTextLabelToPlayer( NPCTekstas, playerid, 0.0, 0.0, 0.0 );
}