[Pedido] congela
#1

alguem me manda um comando de congelar o player e zcmd
Reply
#2

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;
} 
Reply
#3

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.
Reply
#4

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)