help with commands
#1

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
Reply
#2

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
Reply
#3

don't unlock, write server unlocked but he is lock; /
Reply
#4

https://sampwiki.blast.hk/wiki/RCON#Passwording_your_server
Quote:
  • You can't remove the password until you restart the server
Oops..
Reply
#5

You don't know this code ;/?
Reply
#6

mhm ?
Reply
#7

Quote:
Originally Posted by Luka™
https://sampwiki.blast.hk/wiki/RCON#Passwording_your_server
Quote:
  • You can't remove the password until you restart the server
Oops..
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
Reply
#8

i don't see...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)