Making a bot skips the register dialog. - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Making a bot skips the register dialog. (
/showthread.php?tid=474017)
Making a bot skips the register dialog. -
Beckett - 05.11.2013
Lately I've tried to make a bot in my server, I've followed
KC's tutorial, it went all good but then the bot keeps connecting and disconnecting due to the register dialog, how to make the bot skip it?
Thank you.
Re: Making a bot skips the register dialog. -
Konstantinos - 05.11.2013
Quote:
Originally Posted by kc
Common problems
My NPC leaves my server after it joins
Your script is forcing the NPC to login, or you have an anti-cheat / ping kicker that is interfering with your NPC. You can add...
pawn Код:
if(IsPlayerNPC(playerid)) return 1;
... as the first line of any callbacks that bots will use, e.g. OnPlayerRequestClass or OnPlayerRequestSpawn. For an efficient, simple way of excluding NPCs from loops, check out foreach by ******.
My NPC doesn't join my server at all
This is most likely caused by your server being passworded.
I can't get the npc_record filterscript to load
You either don't have the filterscript, or it is already loaded. Try continuing anyway.
My NPC just stands at the spawnpoint
Go back, and re-do the OnPlayerSpawn part of the tutorial.
My NPCs used to connect, but now I have upgraded to >= RC5 they don't.
There is a new maxnpc server.cfg variable that defaults to 0. add...
Код:
maxnpc number_goes_here
...to your server.cfg to fix this issue.
|
kc mentioned what you'll need to do in that case.
Re: Making a bot skips the register dialog. -
Beckett - 06.11.2013
I did it but it didn't work, thats why I am asking here.
Re: Making a bot skips the register dialog. -
Konstantinos - 06.11.2013
It worked fine when I used to have NPCs few years ago. If the register dialog is in a filterscript (an example) and you used the code above in gamemode, it won't work.
Check if the player is NPC before you check whether a player is registered or not.
Re: Making a bot skips the register dialog. -
boomerboom - 06.11.2013
There is a function to check if hes a bot.Sry,I cant give you code i am on my phone.
Re: Making a bot skips the register dialog. -
Beckett - 06.11.2013
Код:
if(IsPlayerNPC(playerid)) return 1;
if(fexist(UserPath(playerid)))
{
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COL_WHITE"Login",""COL_WHITE"Type your password below to login.","Login","Quit");
}
else
{
ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,""COL_WHITE"Registering...",""COL_WHITE"Type your password below to register a new account.","Register","Quit");
}
I've done this before it checks if the account exists, is it supposed to be like this or?