05.08.2011, 15:28
Hi, im trying to get those NPCs working in my gamemod. Therefore i recorded one .rec file (which i renamed to "busdriver" and moved it to "npcmodes->recordings"), created a new botscript (also named "busdriver"), created a new test-gamemod and adjusted the server.cfg.
Server.cfg
npc-script (both busdriver.pwn and busdriver.amx are located in "npcmodes")
Gamemod
Of course i uploaded the newest 0.3c R5 Linux Files to my Server (Linux centOS 32Bit). No matter what im doing, the NPCs wont show up. The NPCs dont connect at all and there is no output like "npc:join" in my server.log.
Server.cfg
Quote:
echo Executing Server Config... lanmode 0 rcon_password password maxplayers 30 port 7777 hostname Busdriver mapname San Fierro gamemode0 busdriver announce 0 query 1 weburl www.website.com maxnpc 10 onfoot_rate 40 incar_rate 40 weapon_rate 40 stream_distance 300.0 stream_rate 1000 |
Код:
#define RECORDING "busdriver" #define RECORDING_TYPE 1 #include <a_npc> main(){} public OnRecordingPlaybackEnd() StartRecordingPlayback(RECORDING_TYPE, RECORDING); #if RECORDING_TYPE == 1 public OnNPCEnterVehicle(vehicleid, seatid) StartRecordingPlayback(RECORDING_TYPE, RECORDING); public OnNPCExitVehicle() StopRecordingPlayback(); #else public OnNPCSpawn() StartRecordingPlayback(RECORDING_TYPE, RECORDING); #endif
Код:
#include <a_samp> new vBus; main() { } public OnGameModeInit() { ConnectNPC("busdriver","busdriver"); vBus = CreateVehicle(541, 1000.0,1000.0, 1000.0, 0.0, 10, 1, -1); AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0); return 1; } public OnGameModeExit() { return 1; } public OnPlayerRequestClass(playerid, classid) { SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746); SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746); SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746); return 1; } public OnPlayerConnect(playerid) { return 1; } public OnPlayerDisconnect(playerid, reason) { return 1; } public OnPlayerSpawn(playerid) { if(IsPlayerNPC(playerid)) { new botname[MAX_PLAYER_NAME]; GetPlayerName(playerid, botname, sizeof(botname)); if(!strcmp(botname, "busdriver", true)) { PutPlayerInVehicle(playerid, vBus, 0); } } return 1; }