01.03.2012, 01:57
Bom galera eh o seguinte, queria o comando /prender id tempo motivo para os administradores.
Quem ajudar ai agradeco.
Quem ajudar ai agradeco.
if(strcmp(cmd, "/cadeia", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USE: /cadeia [ id ] [time(minutes)] [Motivo]");
return 1;
}
new target;
target = ReturnUser(tmp);
new playa;
new time;
playa = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
time = strval(tmp);
if (PlayerInfo[playerid][pAdmin] >= 1)
{
if(admtrampando[playerid] < 2 && PlayerInfo[playerid][pAdmin] != 1342 && PlayerInfo[playerid][pAdmin] != 1350)
{
SendClientMessage(playerid, COLOR_GRAD1, "Vocк nгo estб trabalhando! (/jogar)");
return 1;
}
new offset = idx;
new result[64];
new length = strlen(cmdtext);
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "USE: /cadeia [Id Do Jogador] [motivo]");
return 1;
}
if(IsPlayerConnected(playa))
{
if(playa != INVALID_PLAYER_ID)
{
GetPlayerName(playa, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* Voce foi preso %s.", giveplayer);
SendClientMessage(playerid, COLOR_LIGHTRED, string);
format(string, sizeof(string), "* Voce foi preso pelo Admin %s.", sendername);
SendClientMessage(playa, COLOR_LIGHTRED, string);
ResetPlayerWeapons(playa);
WantedPoints[playa] = 0;
PlayerInfo[playa][pJailed] = 2;
PlayerInfo[playa][pJailTime] = time*60;
SetPlayerInterior(playa, 0);
SetPlayerPos(playa, 107.2300,1920.6311,18.5208);
SetPlayerWorldBounds(playa, 337.5694,101.5826,1940.9759,1798.7453);
format(string, 256, "Admin: %s ID(%d) Prendeu %s ID(%d) Por %d Minutos. Motivo: %s",sendername, playerid, giveplayer,target, time, (result));
SendClientMessageToAll(COLOR_LIGHTRED/*0x63C3F6AA*/, string);
format(string, sizeof(string), "Voce foi preso por %d Minutos em Praзa Publica. Motivo: %s", time, (result));
SendClientMessage(playa, COLOR_LIGHTBLUE, string);
}
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " Voce nгo esta autorizado a usar este comando!");
}
}
return 1;
}
if(strcmp(cmd, "/prisao", true) == 0) {
new aname[MAX_PLAYER_NAME];
GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
format(file, sizeof(file), PASTA_CONTAS, aname);
if(pAdmin[playerid] == 4 || pAdmin[playerid] == 4 || pAdmin[playerid] == 5 || pAdmin[playerid] == 4 || pAdmin[playerid] == 5){
new tmp[256];
new plid;
new Second = strval(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)){
SendClientMessage(playerid, Vermelho, "(ERRO) Use: /prisao [id]");
return 1;
}
plid = strval(tmp);
if(!IsPlayerConnected(plid)){
//SendClientMessage(playerid, Vermelho, "(ERRO) O jogador nгo estб conectado");
return 1;
} else {
if(GetDistanceBetweenPlayers(plid,playerid) < 10){
new pname[MAX_PLAYER_NAME];
new sendername[MAX_PLAYER_NAME];
GetPlayerName(plid, pname, MAX_PLAYER_NAME);
format(string, sizeof(string), "AdmCMD: %s(%i) prendeu vocк por %d segundos.", sendername, playerid, Second);
SendClientMessage(playerid, AzuL4, string);
format(string, sizeof(string), "~g~Preso por: ~n~~r~%s.", sendername);
GameTextForPlayer(plid, string, 1000, 1);
SetPlayerInterior(plid, 3); //Se Mudar ID do Interior MUDE AQUI!
SetPlayerPos(plid, 197.6661,173.8179,1003.0234);
SetPlayerArmour(plid, 0);
TogglePlayerControllable(plid, 0);
ResetPlayerWeapons(plid);
SetTimerEx("Unjail", Second*1000, 0, "i", plid);
format(file2, sizeof(file2), PASTA_CONTAS, pname);
format(string, sizeof(string), "[INFO]O Admin %s te prendeu.", aname);
SendClientMessage(plid, AzuL4, string);
format(string, sizeof(string), "[INFO] O Admin %s (%d) botou : %s (%d) na Cela Admin", aname,playerid,pname,plid);
SendClientMessageToAll(Verde, string);
SetPlayerHealth(plid, 99999999);
ResetPlayerWeapons(plid);
SendClientMessage(playerid, COLOR_GREEN, "[INFO] Preso com sucesso.");
SetPlayerWantedLevel(plid, 0);
preso[plid] = 1;
TogglePlayerControllable(plid, 1);
if(IsPlayerConnected(plid)){
if(Mute[playerid] == 1)
{
SendClientMessage(playerid, Vermelho, "|_INFO_|Vocк nгo pode falar na cadeia");
return 0;
}