[Ajuda] Da pra fazer isso em ZCMD e SSCANF ?
#1

To querendo fazer o /tv, e o /congelar em apenas um comando.
Pra nгo ter que fazer /parartv e /descongelar entendem ?
Tem como fazer isso em ZCMD ?

Se sim, alguйm pode me dar uma base de como ?
Reply
#2

Quote:
Originally Posted by Mr_Taxi
Посмотреть сообщение
To querendo fazer o /tv, e o /congelar em apenas um comando.
Pra nгo ter que fazer /parartv e /descongelar entendem ?
Tem como fazer isso em ZCMD ?

Se sim, alguйm pode me dar uma base de como ?
pawn Код:
CMD:tv(playerid,params[])
{
     //Codigo
}
else
{
     // Codigo
     return 1;
}
Se Nгo me Engano usa-se assim, else ou else if.

@Edit - Nem Percebi isso, agora que fui ver, Vlw Pedro '-'
Reply
#3

Quote:
Originally Posted by .FuneraL.
Посмотреть сообщение
pawn Код:
CMD:tv(playerid,params[])
{
     //Codigo
}
else
{
     // Codigo
}
return 1;
}
Se Nгo me Engano usa-se assim, else ou else if.
Como vocк me abre 2 chaves e fecha 3? E ainda colocando else na public.
Reply
#4

Poxa nгo entendo vcs... Tem como fazer isso tem como fazer aquilo em ZCMD, vei й tudo a mesma coisa, nгo muda praticamente nada no Conteъdo a nгo ser o params[].

Lуgica Congelar:

pawn Код:
if(Congelado[playerid]) Descongelar.
else Congelar.
Mesma coisa o Tv.

@Edit

Quote:
Originally Posted by .FuneraL.
Посмотреть сообщение
pawn Код:
CMD:tv(playerid,params[])
{
     //Codigo
}
else
{
     // Codigo
     return 1;
}
Se Nгo me Engano usa-se assim, else ou else if.

@Edit - Nem Percebi isso, agora que fui ver, Vlw Pedro '-'
O que leva um pessoa a colocar else em um PUBLIC!

Macro ZCMD!

pawn Код:
#define COMMAND:%1(%2)          \
            forward cmd_%1(%2); \
            public cmd_%1(%2)
Vocк estб fazendo isso para o Compilador!

pawn Код:
forward cmd_tv(playerid, params[]);
public cmd_tv(playerid, params[])
{
     //Codigo
}
else
{
     // Codigo
     return 1;
}
Reply
#5

Vlw ae povo, Paulo, й que pra falar a verdade eu nunca fiz esse comando em strmcp por isso perguntei, Sorry.
Mais obrigado por responder...
Reply
#6

pawn Код:
CMD:tv(playerid, params[])
{
    if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "Vocк nгo й administrador!");
    new bool:L_ESPIONANDO[MAX_PLAYERS], L_ID;
    if(!L_ESPIONANDO[playerid])
    {
        if(sscanf(params, "u", L_ID)) return SendClientMessage(playerid, -1, "Use: /tv [playerid]");
        TogglePlayerSpectating(playerid, 1);
        if(IsPlayerInAnyVehicle(L_ID)) return PlayerSpectateVehicle(playerid, GetPlayerVehicleID(L_ID));
        PlayerSpectatePlayer(playerid, userid);
        L_ESPIONANDO[playerid] = true;
        return 1;
    }
    else
    {
        TogglePlayerSpectating(playerid, 0);
        SetPlayerVirtualWorld(playerid, 0);
        SetPlayerInterior(playerid, 0);
        L_ESPIONANDO[playerid] = false;
        return 1;
    }
    return 1;
}  

CMD:congelar(playerid, params[])
{
    if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "Vocк nгo й administrador!");
    new bool:L_CONGELADO[MAX_PLAYERS], L_ID;
    if(sscanf(params, "u", L_ID)) return SendClientMessage(playerid, -1, "Use: /congelar [playerid]");
    if(!L_CONGELADO[L_ID])
    {
        TogglePlayerControllable(L_ID, 0);
        SendClientMessage(playerid, -1, "Jogador congelado!");
        L_CONGELADO[L_ID] = true;
        return 1;
    }
    else
    {
        TogglePlayerControllable(L_ID, 1);
        SendClientMessage(playerid, -1, "Jogador descongelado!");
        L_CONGELADO[L_ID] = false;
        return 1;
    }
    return 1;
}
Reply
#7

#offtopic

Tiraram o Cуdigos ъteis ?
Reply
#8

Quote:
Originally Posted by humildadeforever
Посмотреть сообщение
#offtopic

Tiraram o Cуdigos ъteis ?
O Luxurion moveu para Lanзamentos/Releases.

Abraзos.
Reply
#9

Quote:
Originally Posted by Los
Посмотреть сообщение
O Luxurion moveu para Lanзamentos/Releases.

Abraзos.
Atб, nгo tinha visto. Vlw xD

Ficou mais organizado e melhor agora hehe.
Reply
#10

Quote:
Originally Posted by humildadeforever
Посмотреть сообщение
Atб, nгo tinha visto. Vlw xD

Ficou mais organizado e melhor agora hehe.
Й provisуrio.

Quote:
Originally Posted by LuxurioN™
Посмотреть сообщение
Este tуpico passarб por algumas mudanзas e dentro deste perнodo permanecerб em "Lanзamentos/Releases".
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)