if(!strcmp(cmd, "/aprenderoff", true))
{
if(aInfo[playerid][Admin] == 1)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COR_ERRO, "Uso vбlido: correto /aPrenderOFF [Nick] [Tempo] [Motivo]");
return 1;
}
format(gFile, sizeof(gFile), "Contas/%s.ini", tmp);
if(!fexist(gFile))
{
SendClientMessage(playerid, COR_ERRO, "Nгo existe nenhuma conta com esse nick!");
return 1;
}
tmp = strtok(cmdtext, idx);
if(! strlen(tmp))
{
SendClientMessage(playerid, COR_ERRO, "Uso vбlido: /aPrenderOFF [Nick] [Tempo] [Motivo]");
return 1;
}
new
iTempo = strval(tmp)
;
if(iTempo < 1 || iTempo > 600)
{
SendClientMessage(playerid, COR_ERRO, "Tempo somente de 1 а 600 minutos ! ");
return 1;
}
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))
{
SendClientMessage(playerid, COR_ERRO, "Uso vбlido: /aPrenderOFF [Nick] [Tempo] [Motivo]");
return 1;
}
SendClientMessage(playerid, 0x33CCFFAA, "(PuniзгoOff) Conta punida com sucesso!");
WE_SetInt(gFile, "Abuser", 1);
WE_SetInt(gFile, "Preso", iTempo*60);
}
else
{
SendClientMessage(playerid, COR_ERRO, "Vocк nгo tem permissгo!");
}
return 1;
}
olб! peguei um sistema de agendar prisгo,porem quando agendo a prisгo do jogador e o mesmo loga o jogador nгo vai preso. Alguem pode ajudar? Obrigado!!
CMD: PHP код:
|
public OnPlayerSpawn(playerid)
Tente colocar uma funзгo em:
PHP код:
|
if(!strcmp(cmd, "/aprenderoff", true))
{
if(aInfo[playerid][Admin] == 1 || aInfo[playerid][AdminL] == 1)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COR_ERRO, "| ERRO | Digite: correto /aPrenderOFF [Nick] [Tempo] [Motivo]");
return 1;
}
format(gFile, sizeof(gFile), "Contas/%s.ini", tmp);
if(!fexist(gFile))
{
SendClientMessage(playerid, COR_ERRO, "Nгo existe nenhuma conta com esse nick!");
return 1;
}
tmp = strtok(cmdtext, idx);
if(! strlen(tmp))
{
SendClientMessage(playerid, COR_ERRO, "| ERRO | Digite: /aPrenderOFF [Nick] [Tempo] [Motivo]");
return 1;
}
new
iTempo = strval(tmp)
;
if(iTempo < 1 || iTempo > 600)
{
SendClientMessage(playerid, COR_ERRO, "Tempo somente de 1 а 600 minutos ! ");
return 1;
}
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[1000];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COR_ERRO, "| ERRO | Digite: /aPrenderOFF [Nick] [Tempo] [Motivo]");
return 1;
}
SendClientMessage(playerid, 0x33CCFFAA, "(PuniзгoOff) Conta punida com sucesso!");
SendClientFormatAll(0xADFF2FFF, "| BvD-Admin | O(A) Staff %s agendou a prisгo do jogador(a) %s por %d Minutos Pelo ( Motivo: %s )", PlayerName(playerid),PlayerName(idx),iTempo,result);
SetPrisao(PlayerName(idx));
WE_SetInt(gFile, "Abuser", 1);
WE_SetInt(gFile, "Preso", iTempo*60);
}
else
{
SendClientMessage(playerid, COR_ERRO, "Vocк nгo tem permissгo!");
}
return 1;
}
Obrigado!! mais eu fiz algo diferente,eu criei um cmd que atй deu "funcionou" sу que nгo consigo achar o parametro do player para agendar a prisгo: exemplo: "/aprenderoff [CSS]Fulano Teste" dai a mensagem aparece assim: "| BvD-Admin | O(A) Staff %s agendou a prisгo do jogador(a) por %d Minutos Pelo ( Motivo: teste )" e o nick do jogador nгo aparece.
PHP код:
|