[Pedido] Animaзao no cmd /algemar
#1

Eu quero uma Ajudo com o comando /algemar .
Que quando o player for algemado , faзa aquele anim. com ele com as maos atras das costas!
Ai esta meu Comando de Algemar !

pawn Код:
if(strcmp(cmd, "/algemar", true) == 0) {
new aname[MAX_PLAYER_NAME];
GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
format(file, sizeof(file), PASTA_CONTAS, aname);
if(dini_Int(file, "Profissao") == Policial_M || dini_Int(file, "Profissao") == Policial_C || dini_Int(file, "Profissao") == Policial_F || dini_Int(file, "Profissao") == Delegado || dini_Int(file, "Profissao") == Bope || dini_Int(file, "Profissao") == Swat || dini_Int(file, "Profissao") == Narcoticos || dini_Int(file, "Profissao") == FBI || dini_Int(file, "Profissao") == Interpol ||dini_Int(file, "Profissao") == LSPD || dini_Int(file, "aAdmin") == 1){
new tmp[256];
new plid;
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)){
SendClientMessage(playerid, Vermelho, "(ERRO) Use: /algemar [id]");
return 1;
}
plid = strval(tmp);
if(IsPlayerInAnyVehicle(plid) == 1 || IsPlayerInAnyVehicle(playerid) == 1){
SendClientMessage(playerid, Vermelho, "(ERRO) Alguem estб dentro de um carro.");
return 1 ;
}
if(plid == playerid){
SendClientMessage(playerid, Vermelho, "(ERRO) Vocк nгo pode algemar vocк mesmo.");
return 1 ;
}
if(!IsPlayerConnected(plid)){
SendClientMessage(playerid, Vermelho, "(ERRO) O jogador nгo estб conectado");
return 1;
} else {
if(GetDistanceBetweenPlayers(plid,playerid) < 10){
format(string, sizeof(string), "(INFO) O Policial %s te algemou.", aname);
SendClientMessage(plid, Blue, string);
TogglePlayerControllable(plid, 0);
SendClientMessage(playerid, COLOR_GREEN, "(INFO) Algemado com sucesso.");
algemado[plid] = 1;
return 1;
} else {
SendClientMessage(playerid,Vermelho,"(ERRO) Chegue mais perto para algemar.");
return 1;
}
}
} else {
SendClientMessage(playerid,Vermelho,"(ERRO) Apenas policiais podem usar este comando.");
return 1;
}
}


if(strcmp(cmd, "/desalgemar", true) == 0) {
new aname[MAX_PLAYER_NAME];
GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
format(file, sizeof(file), PASTA_CONTAS, aname);
if(dini_Int(file, "Profissao") == Policial_M || dini_Int(file, "Profissao") == Policial_C || dini_Int(file, "Profissao") == Policial_F || dini_Int(file, "Profissao") == Delegado || dini_Int(file, "Profissao") == Bope || dini_Int(file, "Profissao") == Swat || dini_Int(file, "Profissao") == Narcoticos || dini_Int(file, "Profissao") == FBI || dini_Int(file, "Profissao") == Interpol || dini_Int(file, "Profissao") == LSPD || dini_Int(file, "aAdmin") == 1){
new tmp[256];
new plid;
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)){
SendClientMessage(playerid, Vermelho, "(ERRO) Use: /desalgemar [id]");
return 1;
}
plid = strval(tmp);
if(IsPlayerInAnyVehicle(plid) == 1 || IsPlayerInAnyVehicle(playerid) == 1){
SendClientMessage(playerid, Vermelho, "(ERRO) Alguem estб dentro de um carro.");
return 1 ;
}
if(plid == playerid){
SendClientMessage(playerid, Vermelho, "(ERRO) Vocк nгo pode tirar algemas de vocк mesmo.");
return 1 ;
}
if(!IsPlayerConnected(plid)){
SendClientMessage(playerid, Vermelho, "(ERRO) O jogador nгo estб conectado");
return 1;
} else {
if(GetDistanceBetweenPlayers(plid,playerid) < 10){
format(string, sizeof(string), "(INFO) O Policial %s te desalgemou.", aname);
SendClientMessage(plid, Blue, string);
TogglePlayerControllable(plid, 1);
SendClientMessage(playerid, COLOR_GREEN, "(INFO) Desalgemado com sucesso.");
algemado[plid] = 0;
return 1;
} else {
SendClientMessage(playerid,Vermelho,"(INFO) Chegue mais perto para desalgemar.");
return 1;
}
}
} else {
SendClientMessage(playerid,Vermelho,"(INFO) Apenas policiais podem usar este comando.");
return 1;
}
}
Obs: Quando ele for desalgemado , ele volte ao normal !
Reply
#2

pawn Код:
SetPlayerSpecialAction(playerid, SPECIAL_ACTION_CUFFED);
Reply
#3

onde exatamente eu ponho isso ?
Reply
#4

esse codigo de /algemar nao e seu nao neh ?
Reply
#5

pawn Код:
if(strcmp(cmd, "/algemar", true) == 0)
{
    new aname[MAX_PLAYER_NAME];
    GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
    format(file, sizeof(file), PASTA_CONTAS, aname);
    if(dini_Int(file, "Profissao") == Policial_M || dini_Int(file, "Profissao") == Policial_C || dini_Int(file, "Profissao") == Policial_F || dini_Int(file, "Profissao") == Delegado || dini_Int(file, "Profissao") == Bope || dini_Int(file, "Profissao") == Swat || dini_Int(file, "Profissao") == Narcoticos || dini_Int(file, "Profissao") == FBI || dini_Int(file, "Profissao") == Interpol ||dini_Int(file, "Profissao") == LSPD || dini_Int(file, "aAdmin") == 1)
    {
        new tmp[256];
        new plid;
        tmp = strtok(cmdtext, idx);
        if(!strlen(tmp))
        {
            SendClientMessage(playerid, Vermelho, "(ERRO) Use: /algemar [id]");
            return 1;
        }
        plid = strval(tmp);
        if(IsPlayerInAnyVehicle(plid) == 1 || IsPlayerInAnyVehicle(playerid) == 1)
        {
            SendClientMessage(playerid, Vermelho, "(ERRO) Alguem estб dentro de um carro.");
            return 1 ;
        }
        if(plid == playerid)
        {
            SendClientMessage(playerid, Vermelho, "(ERRO) Vocк nгo pode algemar vocк mesmo.");
            return 1 ;
        }
        if(!IsPlayerConnected(plid))
        {
            SendClientMessage(playerid, Vermelho, "(ERRO) O jogador nгo estб conectado");
            return 1;
        }
        else
        {
            if(GetDistanceBetweenPlayers(plid,playerid) < 10)
            {
                format(string, sizeof(string), "(INFO) O Policial %s te algemou.", aname);
                SendClientMessage(plid, Blue, string);
                TogglePlayerControllable(plid, 0);
                SendClientMessage(playerid, COLOR_GREEN, "(INFO) Algemado com sucesso.");
                algemado[plid] = 1;
                SetPlayerSpecialAction(plid, SPECIAL_ACTION_CUFFED);
            }
            else
            {
                SendClientMessage(playerid,Vermelho,"(ERRO) Chegue mais perto para algemar.");
            }
        }
    }
    else
    {
        SendClientMessage(playerid,Vermelho,"(ERRO) Apenas policiais podem usar este comando.");
    }
    return 1;
}
Veja se funciona conforme a sua expectativa.
Reply
#6

Cara era bem isso q eu queria mesmo !
mas quando eu desalgemo o player ele continua com a animaзao =(
Reply
#7

pawn Код:
SetPlayerSpecialAction(plid, SPECIAL_ACTION_NONE);
Reply
#8

Mude seu /desalgemar para:

pawn Код:
if(strcmp(cmd, "/desalgemar", true) == 0) {
new aname[MAX_PLAYER_NAME];
GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
format(file, sizeof(file), PASTA_CONTAS, aname);
if(dini_Int(file, "Profissao") == Policial_M || dini_Int(file, "Profissao") == Policial_C || dini_Int(file, "Profissao") == Policial_F || dini_Int(file, "Profissao") == Delegado || dini_Int(file, "Profissao") == Bope || dini_Int(file, "Profissao") == Swat || dini_Int(file, "Profissao") == Narcoticos || dini_Int(file, "Profissao") == FBI || dini_Int(file, "Profissao") == Interpol || dini_Int(file, "Profissao") == LSPD || dini_Int(file, "aAdmin") == 1){
new tmp[256];
new plid;
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)){
SendClientMessage(playerid, Vermelho, "(ERRO) Use: /desalgemar [id]");
return 1;
}
plid = strval(tmp);
if(IsPlayerInAnyVehicle(plid) == 1 || IsPlayerInAnyVehicle(playerid) == 1){
SendClientMessage(playerid, Vermelho, "(ERRO) Alguem estб dentro de um carro.");
return 1 ;
}
if(plid == playerid){
SendClientMessage(playerid, Vermelho, "(ERRO) Vocк nгo pode tirar algemas de vocк mesmo.");
return 1 ;
}
if(!IsPlayerConnected(plid)){
SendClientMessage(playerid, Vermelho, "(ERRO) O jogador nгo estб conectado");
return 1;
} else {
if(GetDistanceBetweenPlayers(plid,playerid) < 10){
format(string, sizeof(string), "(INFO) O Policial %s te desalgemou.", aname);
SendClientMessage(plid, Blue, string);
TogglePlayerControllable(plid, 1);
SendClientMessage(playerid, COLOR_GREEN, "(INFO) Desalgemado com sucesso.");
algemado[plid] = 0;
SetPlayerSpecialAction(plid, SPECIAL_ACTION_NONE);
return 1;
} else {
SendClientMessage(playerid,Vermelho,"(INFO) Chegue mais perto para desalgemar.");
return 1;
}
}
} else {
SendClientMessage(playerid,Vermelho,"(INFO) Apenas policiais podem usar este comando.");
return 1;
}
}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)