[Pedido] Comandos.
#1

fala galera do forum samp, vim pedir a vocкs os comandos de /TrancarServidor [Senha] e /DestrancarServidor, sei q tenho q usar SendRconCommand("password"... mais o resto nгo sei, vlw
+REP << Pra Quem Conseguir
Reply
#2

Um simples usando sscanf e zcmd:

PHP код:
CMD:trancarservidor (playeridparams[])
{
new 
SenhaServer[128], String[188];
if(!
IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1"Vocк nгo tem permissгo para utilizar esse comando");
if(
sscanf(params"s[128]"SenhaServer)) return SendClientMessage(playeridCOR_VERMELHO"Use: /trancarservidor  [Senha]");
format(Stringsizeof(String), "password %s"SenhaServer);
SendRconCommand(String);
SendClientMessage(playerid, -1"Servidor trancado!");
return 
1;

Reply
#3

Quote:
Originally Posted by NexNix
Посмотреть сообщение
Um simples usando sscanf e zcmd:

PHP код:
CMD:trancarservidor (playeridparams[])
{
new 
SenhaServer[128], String[188];
if(!
IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1"Vocк nгo tem permissгo para utilizar esse comando");
if(
sscanf(params"s[128]"SenhaServer)) return SendClientMessage(playeridCOR_VERMELHO"Use: /trancarservidor  [Senha]");
format(Stringsizeof(String), "password %s"SenhaServer);
SendRconCommand(String);
SendClientMessage(playerid, -1"Servidor trancado!");
return 
1;

Definindo a senha para '0' ele retira correto?
Reply
#4

Quote:
Originally Posted by matheusspohr
Посмотреть сообщение
Definindo a senha para '0' ele retira correto?
Vocк nunca vai saber se nгo tentar.
Reply
#5

Quote:
Originally Posted by Luan Argolo
Посмотреть сообщение
Vocк nunca vai saber se nгo tentar.
Claro Que Irei testar, mas primeiramente, estou desbugando o meu GM, esqueci que as configuraзхes de um outro meu era diferente, agora estou ocupado para colocar e testar, mais claro que irei testar
Reply
#6

Bom senhor matheusspohr,

Se o senhor estб com sua GM Bugada e estб comeзando a desbuga-la, primeiro desbugue-a depois venha pedir comandos no fуrum, acho que seria melhor dessa forma.

Boa sorte com sua GM! .
Reply
#7

Bom, desbuguei o GM, refiz o cmd:
Код:
CMD:trancarservidor (playerid, params[])
{
new SenhaServer[128], String[188];
if(APlayerData[playerid][PlayerLevel] < 6) return SendClientMessage(playerid, Branco, "{FFFF00}[ERRO]:{FF0000} Vocк Nгo Tem Permiзгo Para Utilizar Este Comando.");
if(sscanf(params, "s[128]", SenhaServer)) return SendClientMessage(playerid, Branco, "{FFFF00}[INFO]:{FF0000} Use: /TrancarServidor [Senha]");
format(String, sizeof(String), "password %s", SenhaServer);
SendRconCommand(String);
//SendClientMessage(playerid, Branco, "Servidor Trancado Com Sucesso, A Senha й: %s", SenhaServer);
return 1;
}
Deixei a linha de mensagem ao adm como comentario pq estava gerando 1 warning, daqui a pouco estarei retirando esse warning e usando ''''0'''' Na Senha, Retira a senha Sim, Vlw a todos
Reply
#8

PHP код:
//SendClientMessage(playerid, Branco, "Servidor Trancado Com Sucesso, A Senha й: %s", SenhaServer); 
Isso vai dar erro, vocк deve formatar a mensagem como no exemplo abaixo:
PHP код:
new Msg[128];
format(Msg128"Servidor trancado com sucesso, a senha й: %s"SenhaServer);
SendClientMessage(playerid, -1Msg); 
Reply
#9

Quote:
Originally Posted by TenhoUmaDuvida
Посмотреть сообщение
PHP код:
//SendClientMessage(playerid, Branco, "Servidor Trancado Com Sucesso, A Senha й: %s", SenhaServer); 
Isso vai dar erro, vocк deve formatar a mensagem como no exemplo abaixo:
PHP код:
new Msg[128];
format(Msg128"Servidor trancado com sucesso, a senha й: %s"SenhaServer);
SendClientMessage(playerid, -1Msg); 
Resumindo, VLW
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)