02.02.2010, 20:45
Well we got our NPCs to login on our test server ( LARP EDIT ).
First step:
We Created a user ini for example:
NPC_BOT.ini
containing:
* we edited this with "pawno"
2nd Step:
We opened our Gamemode and editet the line(s) where it asks what it should do if a player conbnects:
3rd step
after this we logged in with our admin account and recorded a *.rec file
/rcon login RCONPW
/rcon loadfs npc_record
/ofrecord NPC1 ( ofrecord= on foot record , NPC1 is the name or rthe rcord file )
after u recorded what u want to do with the npc we typed:
/stoprecord
ok now we copied and compiled our files like the nice tutorial said it:
http://forum.sa-mp.com/index.php?topic=119947.0 //--- we edited the names mynpc,dave ect. with our own file names so dont be confused ^^
after all we stared our server and the NPCs did what we recorded ^^
but now...
we have the next 2 problems
1: the NPCs are "blinking"
look at the video at minute 1:48 ...
http://www.youtube.com/watch?v=wq745By4x0g
it looks like they respawn again and again -.-
at this point i will thanks to all who worked on the NPC function on samp and for the nice tutorial.
we have shared the info how we got our NPCs to login on a LARP / GF edit =)
and now maybe someone can help us fix the "blink" bug on our npcs?
the 2nd problem is that we cant kill the NPCS oO
someone told me that it works but he didnt told me how =(
First step:
We Created a user ini for example:
NPC_BOT.ini
containing:
Quote:
Key=password //---- this is the login password for our NPC Level=1 AdminLevel=0 DonateRank=0 UpgradePoints=0 ConnectedTime=21 Registered=1 //-----this u need to set to 1 then ur NPC will not be asked for tutorial or something =) Sex=0 Age=0 Origin=0 CK=0 Muted=0 Respect=14 Money=1000300 Bank=8446 Crimes=0 Kills=0 Deaths=0 Arrested=0 WantedDeaths=0 Phonebook=0 LottoNr=0 Fishes=0 BiggestFish=0 Job=0 Paycheck=2716 HeadValue=0 Jailed=0 JailTime=0 Materials=0 Drugs=0 Leader=0 Member=0 FMember=0 Rank=0 Char=162 // ---- this is the skin ID u want that the NPC uses if he spawns. ContractTime=0 DetSkill=0 SexSkill=0 BoxSkill=0 LawSkill=0 MechSkill=0 JackSkill=0 CarSkill=0 NewsSkill=0 DrugsSkill=0 CookSkill=0 FishSkill=0 pSHealth=0.0 pHealth=100.0 Int=0 Local=0 Team=3 Model=7 PhoneNr=273332 Car=999 Car2=999 Car3=999 House=255 Bizz=255 Pos_x=-906.4 Pos_y=-1096.9 Pos_z=98.3 CarLic=0 FlyLic=0 BoatLic=0 FishLic=0 GunLic=0 Gun1=0 Gun2=0 Gun3=0 Gun4=0 Ammo1=0 Ammo2=0 Ammo3=0 Ammo4=0 CarTime=0 PayDay=3 PayDayHad=0 Watch=0 Crashed=0 Wins=0 Loses=0 AlcoholPerk=0 DrugPerk=0 MiserPerk=0 PainPerk=0 TraderPerk=0 Tutorial=0 Mission=0 Warnings=0 VirWorld=0 Fuel=0 Married=0 MarriedTo= FishTool=0 Note1= Note1s=0 Note2= Note2s=0 Note3= Note3s=0 Note4= Note4s=0 Note5= Note5s=0 InvWeapon=0 InvAmmo=0 Lighter=0 Cigarettes=0 Locked=0 |
2nd Step:
We opened our Gamemode and editet the line(s) where it asks what it should do if a player conbnects:
Quote:
public OnPlayerConnect(playerid) //--- gamemode asks what to do when:... { if (IsPlayerNPC(playerid)) //-- a player is an NPC ... { OnPlayerCommandText(playerid,"/login password"); //-- the NPC types in "/login password " without the "" becuz we... SendClientMessageToAll(0x00000000,"An NPC connected!"); //configured the password for our NPC to passwordin our NPC_BOT.ini after this the NPC logs in. return 1; } new plname[MAX_PLAYER_NAME]; GetPlayerName(playerid, plname, sizeof(plname)); if(Security != 0) { SendClientMessage(playerid, COLOR_YELLOW, "text text."); Kick(playerid); return 1; } new namestring = strfind(plname, "_", true); if(namestring == -1) { SendClientMessage(playerid, COLOR_YELLOW2, "text text text."); SendClientMessage(playerid, COLOR_YELLOW2, "more text more text more text."); Kick(playerid); return 1; } |
after this we logged in with our admin account and recorded a *.rec file
/rcon login RCONPW
/rcon loadfs npc_record
/ofrecord NPC1 ( ofrecord= on foot record , NPC1 is the name or rthe rcord file )
after u recorded what u want to do with the npc we typed:
/stoprecord
ok now we copied and compiled our files like the nice tutorial said it:
http://forum.sa-mp.com/index.php?topic=119947.0 //--- we edited the names mynpc,dave ect. with our own file names so dont be confused ^^
after all we stared our server and the NPCs did what we recorded ^^
but now...
we have the next 2 problems
1: the NPCs are "blinking"
look at the video at minute 1:48 ...
http://www.youtube.com/watch?v=wq745By4x0g
it looks like they respawn again and again -.-
at this point i will thanks to all who worked on the NPC function on samp and for the nice tutorial.
we have shared the info how we got our NPCs to login on a LARP / GF edit =)
and now maybe someone can help us fix the "blink" bug on our npcs?
the 2nd problem is that we cant kill the NPCS oO
someone told me that it works but he didnt told me how =(