help with commands - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: help with commands (
/showthread.php?tid=106760)
help with commands -
knopke - 05.11.2009
dcmd_unlock(playerid,params[])
{
#pragma unused params
if(!IsPlayerAdmin(playerid)) SendClientMessage(playerid, AAD_COLOR_GREY, "Error: You need to be admin to do that!");
{
SendRconCommand("password");
}
{
SendClientMessage(playerid,AAD_COLOR_RED,"[SERVER]: Serveris atrakintas");
}
return 1;
}
dcmd_lock(playerid,params[])
{
#pragma unused params
if(!IsPlayerAdmin(playerid)) SendClientMessage(playerid, AAD_COLOR_GREY, "Error: You need to be admin to do that!");
{
SendRconCommand("password Ksdxqwef896ycasdfas45fge215689dasq");
SendClientMessage(playerid,AAD_COLOR_RED,"[SERVER]: Serveris uzrakintas! Atrakinti reikia /gmx");
}
return 1;
}
I write /unlock but dont unlocked server
so wtf? Help me
Re: help with commands -
Luka P. - 05.11.2009
Try this
pawn Код:
dcmd_unlock(playerid,params[])
{
#pragma unused params
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,AAD_COLOR_GREY,"Error: You need to be RCON admin to do that!");
else
{
SendRconCommand("password 0");
SendClientMessage(playerid,AAD_COLOR_RED,"[SERVER]: Server unlocked!");
}
return 1;
}
pawn Код:
dcmd_lock(playerid,params[])
{
#pragma unused params
new password[64],string[64];
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,AAD_COLOR_GREY,"Error: You need to be RCON admin to do that!");
else
{
if(sscanf(params,"s",password)) return SendClientMessage(playerid,AAD_COLOR_GREY,"USE: /lock [password]");
else
{
format(string,sizeof(string),"password %s",password);
SendRconCommand(string);
}
}
return 1;
}
I didn't test it, I've created it in this forum message editor

Also password included, so you will need /lock [password] not just /lock
Re: help with commands -
knopke - 05.11.2009
don't unlock, write server unlocked but he is lock; /
Re: help with commands -
Luka P. - 05.11.2009
https://sampwiki.blast.hk/wiki/RCON#Passwording_your_server
Quote:
- You can't remove the password until you restart the server
|
Oops..
Re: help with commands -
knopke - 05.11.2009
You don't know this code ;/?
Re: help with commands -
knopke - 05.11.2009
mhm ?
Re: help with commands -
Ritchie999 - 05.11.2009
Quote:
Originally Posted by Luka™
|
there was a script i was using that allowed to lock the server and unlock, it wasnt through rcon though, you could join the game but you had to type the password into the chatbox or you get kicked
Re: help with commands -
knopke - 05.11.2009
i don't see...