[Pedido] comando kill com comtagem
#1

comando kill com comtagem tipo o cara digita /kill ae fala espere 10 segundos parado e o server ira le mata
ajuda

cmd
================================================== ==
if (strcmp("/kill", cmdtext, true, 10) == 0)

{
SetPlayerHealth(playerid, 0);
new pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, MAX_PLAYER_NAME);
format(string, sizeof(string), "%s se {FF00FF}matou {FF0000}( /kill )", pname);
SendClientMessageToAll(COLOR_YELLOW, string);
return 1;
}
================================================== ===
Reply
#2

pawn Код:
if(strcmp("/kill", cmdtext, true, 10) == 0)
{
    SetTimer("killplayer", 10000, false);
   
    SendClientMessage(playerid,COLOR_YELLOW,"espere 10s pra morrer");
    return 1;
}


forward killplayer();
public killplayer()
{
    SetPlayerHealth(playerid, 0);
   
    format(string, sizeof(string), "%s se {FF00FF}matou {FF0000}( /kill )", pname);
    SendClientMessageToAll(COLOR_YELLOW, string);
}
Reply
#3

pawn Код:
if ( !strcmp("/kill", cmdtext, true)) {

    TogglePlayerControllable(playerid, 0);
    GameTextForPlayer(playerid, "~r~Aguarde 10 segundos", 1000, 3);
   
    SetTimerEx("killMe", 10000, false, "d", playerid);
    return 1;
}

// fora de OnPlayerCommandText
forward killMe(playerid);
public killMe(playerid) {

    TogglePlayerControllable(playerid, 1);
    SetPlayerHealth(playerid, 0);
   
    new pname[MAX_PLAYER_NAME];
    GetPlayerName(playerid, pname, MAX_PLAYER_NAME);
   
    format(string, sizeof(string), "%s se {FF00FF}matou {FF0000}( /kill )", pname);
    SendClientMessageToAll(COLOR_YELLOW, string);
    return 1;
}
Reply
#4

a onde colocor esse e fora do onplayercomandtext eu colocei no fim do gm eu tenho q colocar onde

forward killMe(playerid);
public killMe(playerid) {

TogglePlayerControllable(playerid, 1);
SetPlayerHealth(playerid, 0);

new pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, MAX_PLAYER_NAME);

format(string, sizeof(string), "%s se {FF00FF}matou {FF0000}( /kill )", pname);
SendClientMessageToAll(COLOR_YELLOW, string);
return 1;
}
Reply
#5

Quote:
Originally Posted by xXCallXX
Посмотреть сообщение
a onde colocor esse e fora do onplayercomandtext eu colocei no fim do gm eu tenho q colocar onde

forward killMe(playerid);
public killMe(playerid) {

TogglePlayerControllable(playerid, 1);
SetPlayerHealth(playerid, 0);

new pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, MAX_PLAYER_NAME);

format(string, sizeof(string), "%s se {FF00FF}matou {FF0000}( /kill )", pname);
SendClientMessageToAll(COLOR_YELLOW, string);
return 1;
}
Pode ser no fim do gamemode, desde que nгo esteja dentro de nenhuma callback.


Exemplo do modo errado:

pawn Код:
stock souSexy(name[]) {

    if (!strcmp(name, "iCasTiel"))
        return SendClientMessageToAll(-1, "Todos ja sabem!");
    else
        return SendClientMessage(playerid, -1, "Vocк nгo й iCasTiel, logo nгo й sexy");
       
    forward killMe(playerid);
    public killMe(playerid) {

        TogglePlayerControllable(playerid, 1);
        SetPlayerHealth(playerid, 0);

        new pname[MAX_PLAYER_NAME], string[128];
        GetPlayerName(playerid, pname, MAX_PLAYER_NAME);

        format(string, sizeof(string), "%s se {FF00FF}matou {FF0000}( /kill )", pname);
        SendClientMessageToAll(COLOR_YELLOW, string);
        return 1;
    }
    return 1;
}
Exemplo do modo correto:

pawn Код:
stock souSexy(name[]) {

    if (!strcmp(name, "iCasTiel"))
        return SendClientMessageToAll(-1, "Todos ja sabem!");
    else
        return SendClientMessage(playerid, -1, "Vocк nгo й iCasTiel, logo nгo й sexy");
       
    return 1;
}

forward killMe(playerid);
public killMe(playerid) {

    TogglePlayerControllable(playerid, 1);
    SetPlayerHealth(playerid, 0);

    new pname[MAX_PLAYER_NAME], string[128];
    GetPlayerName(playerid, pname, MAX_PLAYER_NAME);

    format(string, sizeof(string), "%s se {FF00FF}matou {FF0000}( /kill )", pname);
    SendClientMessageToAll(COLOR_YELLOW, string);
    return 1;
}
Reply
#6

entende VLW POR ME AJUDA MAIS UMA VEZ
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)