[Ajuda] Ajuda?
#1

Eu queria um timer (sabe akeles negocio de /contar dai 3,2,1 go)so para adm level3 pra cima e que quando o timer for acionado,ninguem podera se mecher assim nao havera trapaзa,Podem azer isso por gentileza para mim??
Reply
#2

SetTimer: https://sampwiki.blast.hk/wiki/SetTimerEx
Congelar/Descongelar: https://sampwiki.blast.hk/wiki/TogglePlayerControllable
Variaveis: https://sampforum.blast.hk/showthread.php?tid=235924
Reply
#3

pawn Код:
new tempo = 3;

CMD:contar(playerid) {
    Contar();
    SendClientMessage(playerid, -1, "Contagem iniciada!");
    for(new i; i < MAX_PLAYERS; ++i) {
        TogglePlayerControllable(i, false);
    }
    return true;
}

forward Contar();
public Contar() {
    if(!tempo) {
        tempo = 3;
        GameTextForAll("GO !", 2000, 4);
        for(new i; i < MAX_PLAYERS; ++i) {
            TogglePlayerControllable(i, true);
        }
        return false;
    }
    new s[128];
    format(s, 128, "%i", tempo);
    GameTextForAll(s, 2000, 4);
    SetTimer("Contar", 1000, false);
    tempo --;
    return true;
}
Reply
#4

Quote:
Originally Posted by zbt
Посмотреть сообщение
pawn Код:
new tempo = 3;

CMD:contar(playerid) {
    Contar();
    SendClientMessage(playerid, -1, "Contagem iniciada!");
    for(new i; i < MAX_PLAYERS; ++i) {
        TogglePlayerControllable(i, false);
    }
    return true;
}

forward Contar();
public Contar() {
    if(!tempo) {
        tempo = 3;
        GameTextForAll("GO !", 2000, 4);
        for(new i; i < MAX_PLAYERS; ++i) {
            TogglePlayerControllable(i, true);
        }
        return false;
    }
    new s[128];
    format(s, 128, "%i", tempo);
    GameTextForAll(s, 2000, 4);
    SetTimer("Contar", 1000, false);
    tempo --;
    return true;
}
Cara num deu nao Tente faze com da pra tu modifica esse?
pawn Код:
if (strcmp(cmdtext, "/contar", true)==0)
{
new aname[MAX_PLAYER_NAME];
GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
format(file, sizeof(file), PASTA_CONTAS, aname);
if(pAdmin[playerid] > 0){
if(Count >= 3)
{
SendClientMessage(playerid, 0x33AA33AA, "(INFO) Contador й iniciado!");
CountDown();
return 1;
}else{
SendClientMessage(playerid, 0xAA3333AA, "(ERRO) Contador jб estб ativado!");
return 1;
}
}
}
Reply
#5

Topo do GM:

new tempo = 3;

Bota dentro da public OnPlayerCommandText:
pawn Код:
if (strcmp(cmdtext, "/contar", true)==0)
{
    Contar();
    SendClientMessage(playerid, -1, "Contagem iniciada!");
    for(new i; i < MAX_PLAYERS; ++i) {
        TogglePlayerControllable(i, false);
    }
    return true;
}
Bota no final do GM:
pawn Код:
forward Contar();
public Contar() {
    if(!tempo) {
        tempo = 3;
        GameTextForAll("GO !", 2000, 4);
        for(new i; i < MAX_PLAYERS; ++i) {
            TogglePlayerControllable(i, true);
        }
        return false;
    }
    new s[128];
    format(s, 128, "%i", tempo);
    GameTextForAll(s, 2000, 4);
    SetTimer("Contar", 1000, false);
    tempo --;
    return true;
}
Nгo testei sу adaptei...
Reply
#6

Quote:
Originally Posted by sanalex
Посмотреть сообщение
Topo do GM:

new tempo = 3;

Bota dentro da public OnPlayerCommandText:
pawn Код:
if (strcmp(cmdtext, "/contar", true)==0)
{
    Contar();
    SendClientMessage(playerid, -1, "Contagem iniciada!");
    for(new i; i < MAX_PLAYERS; ++i) {
        TogglePlayerControllable(i, false);
    }
    return true;
}
Bota no final do GM:
pawn Код:
forward Contar();
public Contar() {
    if(!tempo) {
        tempo = 3;
        GameTextForAll("GO !", 2000, 4);
        for(new i; i < MAX_PLAYERS; ++i) {
            TogglePlayerControllable(i, true);
        }
        return false;
    }
    new s[128];
    format(s, 128, "%i", tempo);
    GameTextForAll(s, 2000, 4);
    SetTimer("Contar", 1000, false);
    tempo --;
    return true;
}
Nгo testei sу adaptei...
Obg cara :3
Reply
#7

De nada , mas lembrando que do jeito que tб aн todo mundo vai poder usar o comando, manda algum comando seu de admin para adaptar se quizer.
Reply
#8

Quote:
Originally Posted by sanalex
Посмотреть сообщение
De nada , mas lembrando que do jeito que tб aн todo mundo vai poder usar o comando, manda algum comando seu de admin para adaptar se quizer.
pawn Код:
if(strcmp(cmd,"/minigun",true)==0){
new aname[MAX_PLAYER_NAME];
GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
format(file, sizeof(file), PASTA_CONTAS, aname);
if(pAdmin[playerid] == 4 || pAdmin[playerid] == 5){
GivePlayerWeapon(playerid, 38, 999999);
return 1;
}
}
codigo de Minigun XD mas agora to com otraduvida jaja posto no forum
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)