Comando /agendar -
Fire_Hell - 25.07.2012
Bom gente, eu queria o comando /agendar. Ele faz que quando a pessoa estiver offline, e algum admin querem prender ela, usar esse comando que ela irб para a cadeia.
Aqui ta o meu /cadeia.
pawn Код:
if(strcmp(cmd, "/cadeia",true) == 0)
{
if(IsPlayerConnected(playerid))
{
new tempo[20];
new tempo2;
if(PlayerInfo[playerid][pAdmin] < 2)
{
SendClientMessage(playerid, COLOR_GREY, " Vocк nгo esta autorizado para usar este comando!");
return 1;
}
tmp = strtok(cmdtext, idx);
tempo = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USE: /cadeia [ID] [Tempo] [Razao]");
return 1;
}
if(!strlen(tempo))
{
SendClientMessage(playerid, COLOR_GRAD2, "USE: /cadeia [ID] [Tempo] [Razao]");
return 1;
}
if(PlayerInfo[giveplayerid][pAdmin] >= 1339 && PlayerInfo[playerid][pAdmin] < 1342)
{
SendClientMessage(playerid, COLOR_GRAD1, "Vocк nгo pode dar Cadeia para um Admin Fundador !");
return 1;
}
if(admtrampando[playerid] < 1 && PlayerInfo[playerid][pAdmin] != 1342 && PlayerInfo[playerid][pAdmin] != 1341)
{
SendClientMessage(playerid, COLOR_GRAD1, "Vocк nгo estб trabalhando! (/trabalhar)");
return 1;
}
giveplayerid = ReturnUser(tmp);
tempo2 = strval(tempo);
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
MSGPLAYER(playerid, COLOR_GRAD2, "USE: /cadeia [ID] [Tempo] [Razao]");
return 1;
}
MSGPARATODOS(COLOR_GRAD2, "(=-=-=-=-=-=-=-=({FFD700}Aviso Da Administraзгo{BFC0C2})=-=-=-=-=-=-=-=-=)");
format(string, sizeof(string), "(B.H.S):{FF0000}%s {00FF00}prendeu {FF0000}%s {00FF00}na Cadeia de Admin. Motivo: {FF0000}%s", sendername, giveplayer, (result));
SendClientMessageToAll(COR_GRO, string);
format(string, sizeof(string), "* Vocк Colocou o(a) %s Na Cadeia.", giveplayer);
SendClientMessage(playerid, COLOR_LIGHTRED, string);
if(admtrampando[playerid] == 1 && admhide[playerid] == 1)
{
SendClientMessage(giveplayerid, COLOR_LIGHTRED, "* Vocк foi colocado na Cadeia Pelo Admin Bot_Zinho.");
}
else
{
format(string, sizeof(string), "* Vocк foi colocado na Cadeia Pelo Admin %s.", sendername);
SendClientMessage(giveplayerid, COLOR_LIGHTRED, string);
}
GameTextForPlayer(giveplayerid, "~b~Bem Vindo a ~n~~r~Cadeia", 5000, 3);
ResetPlayerWeaponsEx(giveplayerid);
WantedPoints[giveplayerid] = 0;
SetPlayerWantedLevel(giveplayerid, 0);
PlayerInfo[giveplayerid][pJailed] = 2;
PlayerInfo[giveplayerid][pJailTime] = tempo2 * 60;
SetPlayerInterior(giveplayerid, 6);
SetPlayerPos(giveplayerid,264.6288,77.5742,1001.0391);
//SetPlayerWorldBounds(giveplayerid, 337.5694,101.5826,1940.9759,1798.7453); //285.3481,96.9720,1940.9755,1799.0811
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " O jogador estб offline !");
return 1;
}
}
return 1;
}
Vlw.
Re: Comando /agendar -
Victor' - 25.07.2012
Vocк tem que escrever direto na conta do jogador.
Use a funзгo que salva a conta do player para ver qual variбvel й a de cadeia dai й sу fazer um comando que edita essa variбvel.
AW: Comando /agendar -
Fire_Hell - 25.07.2012
Facil de mais. Mais sу tem um problema. Eu nгo sei fazer isso ¬¬
Re: Comando /agendar -
Victor' - 25.07.2012
Uma vez fiz esse comando para meu gm:
pawn Код:
if(strcmp(cmd,"/punirconta",true)==0 || strcmp(cmd,"/punirnick",true)==0 || strcmp(cmd,"/punirnome",true)==0)
{
if(PlayerInfo[playerid][pAdmin] >= 5000)
{
if(admtrampando[playerid] < 1 && PlayerInfo[playerid][pAdmin] < 5000)
{
SendClientMessage(playerid, COLOR_GRAD1, "Vocк nгo estб trabalhando! (/trabalhar)");
return 1;
}
tmp = strtok(cmdtext,idx);
if(!strlen(tmp))
{
SendClientMessage(playerid,COLOR_GRAD1,"USE: /punirconta [NOME DO JOGADOR]");
return 1;
}
if(strcmp(tmp,"Nick_Protegido",true)==0 || strcmp(tmp,"Nick_Protegido2",true)==0 || strcmp(tmp,"Nick_Protegido3",true)==0)
{
return 1;
}
new arquivo[64];
format(arquivo, sizeof(arquivo), "Players/%s.ini",tmp);
if(!dini_Exists(arquivo))
{
SendClientMessage(playerid,COLOR_GRAD1,"Esta ACC nao foi encontrata na Lista.");
return 1;
}
else
{
dini_IntSet(arquivo,"Jailed",9);
dini_IntSet(arquivo,"JailTime",999);
}
GetPlayerName(playerid, sendername, sizeof(sendername));
if(admtrampando[playerid] == 1 && admhide[playerid] == 1)
{
format(string, 128, "CONTA PUNIDA: Administrador_Secreto puniu a conta %s.",tmp);
ABroadCast(COLOR_YELLOW,string,1);
}
else
{
format(string, 128, "CONTA PUNIDA: %s puniu a conta %s: %s", sendername,tmp);
ABroadCast(COLOR_YELLOW,string,1);
}
}
return 1;
}
AW: Comando /agendar -
Fire_Hell - 25.07.2012
Bom, quando eu dou /punirconta boto o nome certinho ( jб configurei ) nгo da de bota tempo, e o player nгo vai para a prisгo, e nem quando ele loga aparece que ele foi punido.
Traduzindo, o comando nгo funcionou, e aqui estб ele configurado.
pawn Код:
if(strcmp(cmd,"/punirconta",true)==0 || strcmp(cmd,"/punirnick",true)==0 || strcmp(cmd,"/punirnome",true)==0)
{
if(PlayerInfo[playerid][pAdmin] >= 1342)
{
if(admtrampando[playerid] < 1 && PlayerInfo[playerid][pAdmin] < 1342)
{
SendClientMessage(playerid, COLOR_GRAD1, "Vocк nгo estб trabalhando! (/trabalhar)");
return 1;
}
tmp = strtok(cmdtext,idx);
if(!strlen(tmp))
{
SendClientMessage(playerid,COLOR_GRAD1,"USE: /punirconta [NOME DO JOGADOR]");
return 1;
}
if(strcmp(tmp,"Fire_Nando",true)==0 || strcmp(tmp,"Nick_Protegido2",true)==0 || strcmp(tmp,"Nick_Protegido3",true)==0)
{
return 1;
}
new arquivo[64];
format(arquivo, sizeof(arquivo), "Contas/%s.ini",tmp);
if(!dini_Exists(arquivo))
{
SendClientMessage(playerid,COLOR_GRAD1,"Esta ACC nao foi encontrata na Lista.");
return 1;
}
else
{
dini_IntSet(arquivo,"Jailed",9);
dini_IntSet(arquivo,"JailTime",999);
}
GetPlayerName(playerid, sendername, sizeof(sendername));
if(admtrampando[playerid] == 1 && admhide[playerid] == 1)
{
format(string, 128, "CONTA PUNIDA: Bot_Zinho puniu a conta %s.",tmp);
ABroadCast(COLOR_YELLOW,string,1);
}
else
{
format(string, 128, "CONTA PUNIDA: %s puniu a conta %s: %s", sendername,tmp);
ABroadCast(COLOR_YELLOW,string,1);
}
}
return 1;
}