[ajuda] Por Variavel no cmd '-'
#1

pawn Код:
if(strcmp(cmd, "/bomba", true) == 0 || strcmp(cmd, "/atomica", true) == 0)
    {
        format(string, sizeof(string),"%s [ID: %d] estб plantando uma bomba atomica");
        SendClientMessageToAll(0x0080C0AA,string);
        SendClientMessage(playerid,0x0080C0AA,"Fique 4 minutos sem morrer que a bomba atomica irб explodir");
        BombaAtomica[playerid] = 1;
        return 1;
    }
    return 0;
}
stock radiacao(Float:tamanho, Float:x,Float:y,Float:z,string[],cor)
{
        new Float:tempposx, Float:tempposy, Float:tempposz;
        new Float:posx, Float:posy, Float:posz;
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
            if(IsPlayerConnected(i))
            {
                    GetPlayerPos(i, posx, posy, posz);
                    tempposx = (x -posx);
                    tempposy = (y -posy);
                    tempposz = (z -posz);
                    if (((tempposx < tamanho/16) && (tempposx > -tamanho/16)) && ((tempposy < tamanho/16) && (tempposy > -tamanho/16)) && ((tempposz < tamanho/16) && (tempposz > -tamanho/16)))
                    {
                        SendClientMessage(i, cor, string);
                    }
                    else if (((tempposx < tamanho/8) && (tempposx > -tamanho/8)) && ((tempposy < tamanho/8) && (tempposy > -tamanho/8)) && ((tempposz < tamanho/8) && (tempposz > -tamanho/8)))
                    {
                        SendClientMessage(i, cor, string);
                    }
                    else if (((tempposx < tamanho/4) && (tempposx > -tamanho/4)) && ((tempposy < tamanho/4) && (tempposy > -tamanho/4)) && ((tempposz < tamanho/4) && (tempposz > -tamanho/4)))
                    {
                        SendClientMessage(i, cor, string);
                    }
                    else if (((tempposx < tamanho/2) && (tempposx > -tamanho/2)) && ((tempposy < tamanho/2) && (tempposy > -tamanho/2)) && ((tempposz < tamanho/2) && (tempposz > -tamanho/2)))
                    {
                        SendClientMessage(i, cor, string);
                    }
                    else if (((tempposx < tamanho) && (tempposx > -tamanho)) && ((tempposy < tamanho) && (tempposy > -tamanho)) && ((tempposz < tamanho) && (tempposz > -tamanho)))
                    {
                        SendClientMessage(i, cor, string);
                    }
            }
        }
        return 1;
}
strtok(const string[], &index)
{
    new length = strlen(string);
    while ((index < length) && (string[index] <= ' '))
    {
        index++;
    }
    new offset = index;
    new result[20];
    while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
    {
        result[index - offset] = string[index]; index++;
    }
    result[index - offset] = EOS;
    return result;
 }
Queria por estб variavel aqui :
pawn Код:
if(gTeam[playerid] == TEAM_T)
Reply
#2

pawn Код:
if(strcmp(cmd, "/bomba", true) == 0 || strcmp(cmd, "/atomica", true) == 0)
{
    if(gTeam[playerid] !== TEAM_T) return SendClientMessage(playerid, cor_aqui, "  Vocк Nгo й Um Terrorista !");
    format(string, sizeof(string),"%s [ID: %d] estб plantando uma bomba atomica");
    SendClientMessageToAll(0x0080C0AA,string);
    SendClientMessage(playerid,0x0080C0AA,"Fique 4 minutos sem morrer que a bomba atomica irб explodir");
    BombaAtomica[playerid] = 1;
    return 1;
}
testa aew
Reply
#3

Quote:
Originally Posted by Laercio
Посмотреть сообщение
pawn Код:
if(strcmp(cmd, "/bomba", true) == 0 || strcmp(cmd, "/atomica", true) == 0)
    {
        format(string, sizeof(string),"%s [ID: %d] estб plantando uma bomba atomica");
        SendClientMessageToAll(0x0080C0AA,string);
        SendClientMessage(playerid,0x0080C0AA,"Fique 4 minutos sem morrer que a bomba atomica irб explodir");
        BombaAtomica[playerid] = 1;
        return 1;
    }
    return 0;
}
stock radiacao(Float:tamanho, Float:x,Float:y,Float:z,string[],cor)
{
        new Float:tempposx, Float:tempposy, Float:tempposz;
        new Float:posx, Float:posy, Float:posz;
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
            if(IsPlayerConnected(i))
            {
                    GetPlayerPos(i, posx, posy, posz);
                    tempposx = (x -posx);
                    tempposy = (y -posy);
                    tempposz = (z -posz);
                    if (((tempposx < tamanho/16) && (tempposx > -tamanho/16)) && ((tempposy < tamanho/16) && (tempposy > -tamanho/16)) && ((tempposz < tamanho/16) && (tempposz > -tamanho/16)))
                    {
                        SendClientMessage(i, cor, string);
                    }
                    else if (((tempposx < tamanho/8) && (tempposx > -tamanho/8)) && ((tempposy < tamanho/8) && (tempposy > -tamanho/8)) && ((tempposz < tamanho/8) && (tempposz > -tamanho/8)))
                    {
                        SendClientMessage(i, cor, string);
                    }
                    else if (((tempposx < tamanho/4) && (tempposx > -tamanho/4)) && ((tempposy < tamanho/4) && (tempposy > -tamanho/4)) && ((tempposz < tamanho/4) && (tempposz > -tamanho/4)))
                    {
                        SendClientMessage(i, cor, string);
                    }
                    else if (((tempposx < tamanho/2) && (tempposx > -tamanho/2)) && ((tempposy < tamanho/2) && (tempposy > -tamanho/2)) && ((tempposz < tamanho/2) && (tempposz > -tamanho/2)))
                    {
                        SendClientMessage(i, cor, string);
                    }
                    else if (((tempposx < tamanho) && (tempposx > -tamanho)) && ((tempposy < tamanho) && (tempposy > -tamanho)) && ((tempposz < tamanho) && (tempposz > -tamanho)))
                    {
                        SendClientMessage(i, cor, string);
                    }
            }
        }
        return 1;
}
strtok(const string[], &index)
{
    new length = strlen(string);
    while ((index < length) && (string[index] <= ' '))
    {
        index++;
    }
    new offset = index;
    new result[20];
    while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
    {
        result[index - offset] = string[index]; index++;
    }
    result[index - offset] = EOS;
    return result;
 }
Queria por estб variavel aqui :
pawn Код:
if(gTeam[playerid] == TEAM_T)
pawn Код:
if(strcmp(cmd, "/bomba", true) == 0 || strcmp(cmd, "/atomica", true) == 0)
    {
        if(gTeam[playerid] != TEAM_T) return SendClientMessage(playerid, -1, "Vocк nгo й do time X");
        format(string, sizeof(string),"%s [ID: %d] estб plantando uma bomba atomica");
        SendClientMessageToAll(0x0080C0AA,string);
        SendClientMessage(playerid,0x0080C0AA,"Fique 4 minutos sem morrer que a bomba atomica irб explodir");
        BombaAtomica[playerid] = 1;
        return 1;
    }
Nгo sei se foi isso que entendi mais blz.


Quote:
Originally Posted by GabrielDias_Invision
Посмотреть сообщение
pawn Код:
if(strcmp(cmd, "/bomba", true) == 0 || strcmp(cmd, "/atomica", true) == 0)
{
    if(gTeam[playerid] !== TEAM_T) return SendClientMessage(playerid, cor_aqui, "  Vocк Nгo й Um Terrorista !");
    format(string, sizeof(string),"%s [ID: %d] estб plantando uma bomba atomica");
    SendClientMessageToAll(0x0080C0AA,string);
    SendClientMessage(playerid,0x0080C0AA,"Fique 4 minutos sem morrer que a bomba atomica irб explodir");
    BombaAtomica[playerid] = 1;
    return 1;
}
testa aew
Isso simplesmente vai dar erro.
Reply
#4

"!==" LOL, WTF?
Reply
#5

pawn Код:
if(strcmp(cmd, "/bomba", true) == 0 || strcmp(cmd, "/atomica", true) == 0)
    {
        if(gTeam[playerid] == TEAM_T)
        {
            format(string, sizeof(string),"%s [ID: %d] estб plantando uma bomba atomica");
            SendClientMessageToAll(0x0080C0AA,string);
            SendClientMessage(playerid,0x0080C0AA,"Fique 4 minutos sem morrer que a bomba atomica irб explodir");
            BombaAtomica[playerid] = 1;
        }
        else
        {
            SendClientMessage(playerid, -1, "** Vocк nгo pode usar este comando !");
        }
        return 1;
    }
    return 0;
}
Reply
#6

Quote:
Originally Posted by Nake01
Посмотреть сообщение
pawn Код:
if(strcmp(cmd, "/bomba", true) == 0 || strcmp(cmd, "/atomica", true) == 0)
    {
        if(gTeam[playerid] == TEAM_T)
        {
            format(string, sizeof(string),"%s [ID: %d] estб plantando uma bomba atomica");
            SendClientMessageToAll(0x0080C0AA,string);
            SendClientMessage(playerid,0x0080C0AA,"Fique 4 minutos sem morrer que a bomba atomica irб explodir");
            BombaAtomica[playerid] = 1;
        }
        else
        {
            SendClientMessage(playerid, -1, "** Vocк nгo pode usar este comando !");
        }
        return 1;
    }
    return 0;
}
Isso vai dar na mesma coisa que postei acima, a diferenзa й que vocк fez o comando ficar maior.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)