24.06.2010, 06:59
how do i make a bot connect to my server when its need register/login? please help
if(IsPlayerNPC(playerid)) return SpawnPlayer(playerid);
if(IsPlayerNPC(playerid)) return SetPlayerSpawn(playerid);
Originally Posted by big comfy couch
I'm guessing you're using the godfather or an edit of it
in onplayerrequestclass Код:
if(IsPlayerNPC(playerid)) return SpawnPlayer(playerid); Код:
if(IsPlayerNPC(playerid)) return SetPlayerSpawn(playerid); |
//NPC Created By JustinB //Do NOT remove The Line above This #define FILTERSCRIPT #include <a_samp> #if defined FILTERSCRIPT new Super; //Global variable! public OnFilterScriptInit() { print("Viper Filterscript"); ConnectNPC("Kriminal","Kriminal"); Super = CreateVehicle(506, 0.0, 0.0, 5.0, 0.0, 0, 1, 5000); return 1; } public OnFilterScriptExit() { return 1; } #else #endif public OnGameModeInit() { return 1; } public OnPlayerSpawn(playerid) { if(IsPlayerNPC(playerid)) //Checks if the player that just spawned is an NPC. { new npcname[MAX_PLAYER_NAME]; GetPlayerName(playerid, npcname, sizeof(npcname)); //Getting the NPC's name. if(!strcmp(npcname, "Kriminal", true)) //Checking if the NPC's name is MyFirstNPC { PutPlayerInVehicle(playerid, Super, 0); //Putting the NPC into the vehicle we created for it. } return 1; } return 1; } public OnPlayerDeath(playerid, killerid, reason) { return 1; } public OnVehicleSpawn(vehicleid) { return 1; } public OnVehicleDeath(vehicleid, killerid) { return 1; } public OnPlayerText(playerid, text[]) { return 1; }