New Comando -
The_G0dFather - 02.07.2012
Bom estava querendo um comando /agendarcadeia que quando um cara fosse denunciado um ADM entrasse no jogo e desse /agendarcadeia [ID] [TEMPO] [MOTIVO]...
Bom estou querendo um NOVO COMANDO
Vou deixar o comando /cadeia aqui sу para ajudar...

OBS: Sу para reforзar quero um comando novo...
pawn Код:
if(strcmp(cmd, "/cadeia",true) == 0)
{
if(IsPlayerConnected(playerid))
{
new tempo[20];
new tempo2;
if(PlayerInfo[playerid][pAdmin] < 3)
{
SendClientMessage(playerid, COLOR_GREY, " Vocк nгo esta autorizado para usar este comando!");
return true;
}
tmp = strtok(cmdtext, idx);
tempo = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USE: /cadeia [id] [Tempo] [Motivo]");
return true;
}
if(!strlen(tempo))
{
SendClientMessage(playerid, COLOR_GRAD2, "USE: /cadeia [id] [Tempo] [Motivo]");
return true;
}
if(admtrampando[playerid] < 1 && PlayerInfo[playerid][pAdmin] != 1341)
{
SendClientMessage(playerid, COLOR_GRAD1, "Vocк nгo estб trabalhando! (/jogar)");
return true;
}
giveplayerid = ReturnUser(tmp);
tempo2 = strval(tempo);
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[100];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "Admin %s colocou %s na Cadeia, por %s minutos, Motivo: %s",PlayerName(playerid), giveplayer, tempo, (result));
SendClientMessageToAll(COLOR_LIGHTRED, string);
ResetPlayerWeaponsEx(giveplayerid);
OnPlayerUpdate(giveplayerid);
PlayerInfo[giveplayerid][pJailed] = 6;
PlayerInfo[giveplayerid][pJailTime] = tempo2 * 60;
SetPlayerInterior(giveplayerid, 5);
SetPlayerPos(giveplayerid, 318.5804,316.9043,999.1484);
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " O jogador estб offline !");
return true;
}
}
return true;
}
Re: [AJUDA] New Comando -
[BcSTotty_Munson - 02.07.2012
Nгo entendi sua duvida mano..
Re: [AJUDA] New Comando -
The_G0dFather - 02.07.2012
Queria um comando novo para que quando um player entrasse jб fosse automaticamente para a prisгo de ADM
Re: [AJUDA] New Comando -
Macintosh - 02.07.2012
Tens de usar um sistema de salvamento para guardar o nick do player e o tempo em um arquivo, assim toda vez que ele relogar ele nгo irб pro spawn atй que seu tempo acabe.
Re: [AJUDA] New Comando -
Macintosh - 02.07.2012
Vк esse tutorial do DraKiNs
https://sampforum.blast.hk/showthread.php?tid=180237
Re: New Comando -
The_G0dFather - 02.07.2012
faz para mim *_*
Re: New Comando -
Ricop522 - 02.07.2012
pawn Код:
// No comando
stock agendarCadeia( id, nome[], tempo, motivo[] ){
new string[128], nome[24]; GetPlayerName(id, nome, 24);
format(string, 128, "Agendamento/%s.ini", nome);
if(!dini_Exists(string)) dini_Create(string);
dini_IntSet(string, "Tempo", tempo);
dini_Set(string, "Motivo", motivo);
// Feito
return 1;
}
// Ao logar
stock verificarCadeia(playerid){
new string[128], nome[24]; GetPlayerName(playerid, nome, 24);
format(string, 128, "Agendamento/%s.ini", nome);
if(!dini_Exists(string)) return 1;
PlayerInfo[playerid][pJailTime] = dini_Int(string, "Tempo"); // Modifique, acrescente as coordenadas da sua prisгo, as suas variбveis, etc.
SendClientMessage(playerid, -1, dini_Get(string, "Motivo"));
fremove(string);
return 1;
}
Boa sorte
Re: New Comando -
The_G0dFather - 03.07.2012
Nвo consegui nгo.. me ajudemmmm. URGENTE!
Re: New Comando -
ViictorDaay- - 03.07.2012
Cara velho й нncrivel o Ricop ja fez e so vocк adicionar
pawn Код:
verificarCadeia(playerid);
No OnPlayerSpawn
pawn Код:
agendarCadeia( id, nome[], tempo, motivo[] );
No onplayerdisconnect ou no comando.
Re: New Comando -
The_G0dFather - 03.07.2012
ahh desisto se alguйm quiser em ajudar me passa o comando porque sou muito noob!