[Ajuda] Comando de Algemar e desalgemar
#1

Oi amiguinhos, eu sou o Dollynho E hoje, vim pedir uma ajuda а vocкs (Quem nгo ajudar vai pro inverno kk)..

Bom, o que eu quero й que o jogador sу possa utilizar o comando /algemar & /desalgemar quando estiver em 2.0 perto do jogador..

Se puderem, por gentileza, coloque tambйm para que o jogador nгo possa algemar e desalgemar ele mesmo

Desde jб, agradeзo.. Quem ajudar, ganha uma Guaranб Mineiro..

PHP код:
CMD:algemar(playeridparams[])
{
       new 
name[MAX_PLAYER_NAME];
    
GetPlayerName(playeridnamesizeof(name));
    new 
PTiDstring[128];
    if(
pDados[playerid][Organizacao] >= 1)
    if(
sscanf(params"u"PTiD)) return SendClientMessage(playeridCOLOR_GREY"SINTAXE: /algemar [ID]");
       
format(stringsizeof(string), "** %s retira um par de algemas, logo algemando o meliante."name);
    
ProxDetector(5.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
    
SetPlayerSpecialAction(PTiDSPECIAL_ACTION_CUFFED);
    
SetPlayerAttachedObject(PTiD8194186, -0.0319990.024000, -0.024000, -7.900000, -32.000011, -72.2999871.1159981.3220001.406000);
    return 
1;
}
CMD:desalgemar(playeridparams[])
{
       new 
name[MAX_PLAYER_NAME];
    
GetPlayerName(playeridnamesizeof(name));
    new 
PTiD;
    new 
string[128];
    if(
pDados[playerid][Organizacao] >= 1)
    for(new 
i=0i<MAX_PLAYER_ATTACHED_OBJECTSi++)
    if(
sscanf(params"u"PTiD)) return SendClientMessage(playeridCOLOR_GREY"SINTAXE: /desalgemar [ID]");
       
format(stringsizeof(string), "** %s retira um par de algemas dos punhos do meliante."name);
    
ProxDetector(5.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
    
SetPlayerSpecialAction(PTiDSPECIAL_ACTION_NONE);
    
RemovePlayerAttachedObject(PTiD8);
    return 
1;

Reply
#2

PHP код:
    if(strcmp(cmd"/algemar"true) == 0)
    {
     if(
PlayerInfoplayerid ][pProfissao] == Policia_Civil || PlayerInfoplayerid ][pProfissao] == Policia_Federal || PlayerInfoplayerid ][pProfissao] == Interpol || PlayerInfoplayerid ][pProfissao] == Delegado || PlayerInfoplayerid ][pProfissao] == Bope || PlayerInfoplayerid ][pProfissao] == Swat
     
|| PlayerInfoplayerid ][pProfissao] == Narcoticos ||PlayerInfoplayerid ][pProfissao] == Policia_Militar || PlayerInfoplayerid ][pProfissao] == FBI || PlayerInfoplayerid ][pProfissao] == Policia_Rodoviaria)
     {
    
tmp strtok(cmdtextidx);
    if(!
strlen(tmp))
    {
    
SendClientMessage(playeridVermelho"| ERRO | /algemar [id] [motivo]");
    return 
1;
    }
    new 
id strval(tmp);
    new 
MSG[128];
    
MSG strrest(cmdtextidx);
    if(!
strlen(MSG))
    {
    
SendClientMessage(playeridVermelho"| ERRO | /algemar [id] [motivo]");
    return 
1;
    }
    if(!
IsPlayerConnected(id))
    {
    
SendClientMessage(playeridVermelho"| ERRO | Jogador nгo estб conectado!");
    return 
1;
     }
    if(
playerid == id)
       {
    
SendClientMessage(playeridVermelho"| ERRO | Vocк nгo pode algemar vocк mesmo!");
    return 
1;
    }
    if(
GetDistanceBetweenPlayers(playeridid) > 15)
    {
    
SendClientMessage(playeridVermelho"| ERRO | Vocк estб muito longe, chegue mais perto!");
    return 
1;
    }
    new 
str[128];
    
GameTextForPlayer(id"~b~ALGEMADO!"30000);
    new 
sendername[MAX_PLAYER_NAME], giveplayer[MAX_PLAYER_NAME];
    
GetPlayerName(playeridsendernamesizeof(sendername));
    
GetPlayerName(idgiveplayersizeof(giveplayer));
    
format(strsizeof(str), " | ALGEMADO | Vocк foi algemado pelo Policial %s (Motivo: %s)"sendernameMSG);
    
SendClientMessage(idVerdeClarostr);
    
format(strsizeof(str), " | ALGEMADO | Vocк algemou o(a) Jogador(a) %s (Motivo: %s)"giveplayerMSG);
    
SendClientMessage(playeridVerdeClarostr);
    
format(stringsizeof(string),"| CORREGEDORIA | O(A) Policial %s(ID: %d) Algemou %s(ID: %d) ( Motivo: %s )"sendername,playerid,giveplayer,id,MSG);
    
Comandosp(Roxo,string,1);
    
TogglePlayerControllable(id0);
    
SetPlayerSpecialAction(idSPECIAL_ACTION_CUFFED);
    
Algemado[id] = true;
    }
    else
    {
     
SendClientMessage(playeridVermelho"| ERRO | Vocк nгo tem permissгo!");
    }
     return 
1
        

Ai uma base, esta em strtok mas da pra entender e adaptar.
Reply
#3

Thanks! Consegui ^-^
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)