[HELP]: Making server locked - 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: [HELP]: Making server locked (
/showthread.php?tid=474760)
[HELP]: Making server locked -
Areax - 09.11.2013
Hello SA-MP
I would like to know one thing and that is, how can I lock my server ? I know how to lock it like that: Go in server.cfg and then put
password <your password here> , but i would like to lock it with a command, like /lockserver or something. Anyone knows how ?
Thanks!
Re: [HELP]: Making server locked -
Tagathron - 09.11.2013
For example make an variable that checks if it's locked,then when a player joins he gets auto kicked because the server is locked,or he needs to enter an password.
Код:
new serverLocked;
OnPlayerConnect(playerid)
{
if(serverLocked==1)
Kick(playerid);
}
//....
ZCMD:lockserver(playerid, params[])
{
serverLocked=1;
return 1;
}
Re: [HELP]: Making server locked -
erminpr0 - 09.11.2013
Were you referring to this ?
pawn Код:
YCMD:lockserver(playerid, params[], help)
{
#pragma unused help
new admin = IsPlayerAdmin(playerid);
if(admin == 0)
return SendClientMessage(playerid, -1, "Not allowed!");
else if(isnull(params))
return SendClientMessage(playerid, -1, "Usage: /lockserver [password]");
new string[32], string2[128];
format(string, sizeof(string), "password %s", params);
SendRconCommand(string);
format(string2, sizeof(string2), "You have successfuly changed server password, new password: %s", params);
SendClientMessage(playerid, -1, string2);
return 1;
}
Re: [HELP]: Making server locked -
Areax - 09.11.2013
Well, this would works, but i want, to be like that:
Picture
Re: [HELP]: Making server locked -
erminpr0 - 09.11.2013
My code will actually do that..
Re: [HELP]: Making server locked -
Areax - 09.11.2013
Yeah, I saw, it works.