SA-MP Forums Archive
[Pedido] congela - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Pedido] congela (/showthread.php?tid=430986)



congela - xGamminG - 16.04.2013

alguem me manda um comando de congelar o player e zcmd


Re: congela - smiiir - 16.04.2013

PHP Code:
COMMAND:congelar ( playerid, params[] )
{
    static
        
xCelulas [ 100 ],
        
xID,
        
xCongelou [ 24 ],
        
xCongelado [ 24 ]
    ;
    
GetPlayerName ( playerid, xCongelou, 24 ) ;
    
    
GetPlayerName ( xID, xCongelado, 24 ) ;
    
    if ( 
sscanf ( params, "u", xID ) )
        return 
SendClientMessage ( playerid, -1, "[ USE ]: /congelar [ID]" ) ;
        
    
TogglePlayerControllable ( playerid, 0 ) ;
    
    
format ( xCelulas, sizeof ( xCelulas ), "%s Foi congelado pelo adminitrador %s", xCongelado, xCongelou ) ;
    
SendClientMessageToAll ( -1, xCelulas ) ;
    
    
SendClientMessage ( xID, -1, "Vocк foi congelado" ) ;
    return 
1;
} 



Re: congela - Lуs - 16.04.2013

Quote:
Originally Posted by iSmirnoff
View Post
PHP Code:
COMMAND:congelar ( playerid, params[] )
{
    static
        
xCelulas [ 100 ],
        
xID,
        
xCongelou [ 24 ],
        
xCongelado [ 24 ]
    ;
    
GetPlayerName ( playerid, xCongelou, 24 ) ;
    
    
GetPlayerName ( xID, xCongelado, 24 ) ;
    
    if ( 
sscanf ( params, "u", xID ) )
        return 
SendClientMessage ( playerid, -1, "[ USE ]: /congelar [ID]" ) ;
        
    
TogglePlayerControllable ( playerid, 0 ) ;
    
    
format ( xCelulas, sizeof ( xCelulas ), "%s Foi congelado pelo adminitrador %s", xCongelado, xCongelou ) ;
    
SendClientMessageToAll ( -1, xCelulas ) ;
    
    
SendClientMessage ( xID, -1, "Vocк foi congelado" ) ;
    return 
1;
} 
Obtenha o nome do jogador alvo, depois da checagem do sscanf.


Re: congela - zSuYaNw - 16.04.2013

Quote:
Originally Posted by Lуs
View Post
Obtenha o nome do jogador alvo, depois da checagem do sscanf.
Este й um erro grotesco de lуgica...


Estarei postando um tutorial sobre isto, enfim.


pawn Code:
CMD:congelar(playerid, params[]){

    if(isnull(parmas)){
        return  SendClientMessage ( playerid, -1, "[ USE ]: /congelar [ID]" ), false;
    }
   
    if(!IsPlayerConnected(strval(params[0])) || IsPlayerAdmin(strval(params[0])){
        return SendClientMessage(playerid, -1, "Erro: N CONECTADO");
    }
   
    TogglePlayerControllable(strval(params[0]), 0);
   
   
    static str[100], no[24];
    format(str, 100, "%s foi congelado por %s", (GetPlayerName(strval(params[0]), no, 24), no), (GetPlayerName(playerid, no, 24), no));
    SendClientMessageToAll(-1, str);
   
    return true;
}
Nгo testado.