[AJUDA] Dando uns erros aqui :/
#1

ERROS:
pawn Код:
C:\Users\Cliente\Desktop\BGS.pwn(103) : error 017: undefined symbol "cmd"
C:\Users\Cliente\Desktop\BGS.pwn(105) : error 017: undefined symbol "tmp"
C:\Users\Cliente\Desktop\BGS.pwn(105) : error 017: undefined symbol "strtok"
C:\Users\Cliente\Desktop\BGS.pwn(106) : warning 219: local variable "PlayerB" shadows a variable at a preceding level
C:\Users\Cliente\Desktop\BGS.pwn(107) : error 017: undefined symbol "tmp"
C:\Users\Cliente\Desktop\BGS.pwn(108) : error 017: undefined symbol "tmp"
C:\Users\Cliente\Desktop\BGS.pwn(133) : warning 217: loose indentation
C:\Users\Cliente\Desktop\BGS.pwn(135) : error 010: invalid function or declaration
C:\Users\Cliente\Desktop\BGS.pwn(139) : error 010: invalid function or declaration
C:\Users\Cliente\Desktop\BGS.pwn(142) : error 010: invalid function or declaration
C:\Users\Cliente\Desktop\BGS.pwn(143) : error 010: invalid function or declaration
C:\Users\Cliente\Desktop\BGS.pwn(145) : error 010: invalid function or declaration
C:\Users\Cliente\Desktop\BGS.pwn(149) : error 010: invalid function or declaration
C:\Users\Cliente\Desktop\BGS.pwn(151) : error 010: invalid function or declaration
C:\Users\Cliente\Desktop\BGS.pwn(153) : error 010: invalid function or declaration
C:\Users\Cliente\Desktop\BGS.pwn(157) : error 010: invalid function or declaration
C:\Users\Cliente\Desktop\BGS.pwn(159) : error 010: invalid function or declaration
C:\Users\Cliente\Desktop\BGS.pwn(161) : error 010: invalid function or declaration
C:\Users\Cliente\Desktop\BGS.pwn(165) : error 010: invalid function or declaration
C:\Users\Cliente\Desktop\BGS.pwn(167) : error 010: invalid function or declaration
C:\Users\Cliente\Desktop\BGS.pwn(169) : error 010: invalid function or declaration
C:\Users\Cliente\Desktop\BGS.pwn(172) : error 021: symbol already defined: "PlayerB"
C:\Users\Cliente\Desktop\BGS.pwn(173) : error 010: invalid function or declaration
C:\Users\Cliente\Desktop\BGS.pwn(175) : error 010: invalid function or declaration
C:\Users\Cliente\Desktop\BGS.pwn(177) : error 010: invalid function or declaration
C:\Users\Cliente\Desktop\BGS.pwn(179) : error 010: invalid function or declaration
C:\Users\Cliente\Desktop\BGS.pwn(180) : error 021: symbol already defined: "string"
C:\Users\Cliente\Desktop\BGS.pwn(181) : error 021: symbol already defined: "GetPlayerName"

Compilation aborted.Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


26 Errors.
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmd, "/convidar", true) == 0)
    {
        tmp = strtok(cmdtext, idx);
        new PlayerB;
        if(!strlen(tmp)) return SendClientMessage(playerid, Branco, "Uso correto: /convidar [id]");
        PlayerB = strval(tmp);
        if(!IsPlayerConnected(PlayerB)) return SendClientMessage(playerid, Branco, "Este jogador nгo estб conectado");
        if(PlayerInfo[playerid][PMilitar] >= 6)
        {
            PlayerInfo[PlayerB][PMilitar] = 1;
            SendClientMessage(PlayerB, Branco, "Vocк entrou а Polнcia Militar");
            SetPlayerColor(PlayerB, Cor_PMilitar);
            return 1;
        }
        else if(PlayerInfo[playerid][Groove] >= 6)
        {
            PlayerInfo[PlayerB][Groove] = 1;
            SendClientMessage(PlayerB, Branco, "Vocк entrou а Groove");
            SetPlayerColor(PlayerB, Cor_Groove);
            return 1;
        }
        else if(PlayerInfo[playerid][Ballas] >= 6)
        {
            PlayerInfo[PlayerB][Ballas] = 1;
            SendClientMessage(PlayerB, Branco, "Vocк entrou aos Ballas");
            SetPlayerColor(PlayerB, Cor_Ballas);
            return 1;
        }
        return 1;
    }
        return 1;
    }
if(strcmp(cmd, "/demitir", true) == 0)
    {
        tmp = strtok(cmdtext, idx);
        new PlayerB, string[128], demitidor[MAX_PLAYER_NAME];
        if(!strlen(tmp)) return SendClientMessage(playerid, Branco, "Uso correto: /demitir [id]");
        PlayerB = strval(tmp);
        GetPlayerName(playerid, demitidor, sizeof(demitidor));
        if(!IsPlayerConnected(PlayerB)) return SendClientMessage(playerid, Branco, "Este jogador nгo estб conectado");
        if(PlayerInfo[playerid][PMilitar] >= 6)
        {
            if(PlayerInfo[PlayerB][PMilitar] < 1) return SendClientMessage(playerid, Branco, "Este jogador nгo й da sua organizaзгo");
            PlayerInfo[PlayerB][PMilitar] = 0;
            format(string, sizeof(string), "Vocк foi demitido por %s", demitidor);
            SendClientMessage(PlayerB, Branco, string);
            return 1;
        }
        else if(PlayerInfo[playerid][Groove] >= 6)
        {
            if(PlayerInfo[PlayerB][Groove] < 1) return SendClientMessage(playerid, Branco, "Este jogador nгo й da sua organizaзгo");
            PlayerInfo[PlayerB][Groove] = 0;
            format(string, sizeof(string), "Vocк foi demitido por %s", demitidor);
            SendClientMessage(PlayerB, Branco, string);
            return 1;
        }
        else if(PlayerInfo[playerid][Ballas] >= 6)
        {
            if(PlayerInfo[PlayerB][Ballas] < 1) return SendClientMessage(playerid, Branco, "Este jogador nгo й da sua organizaзгo");
            PlayerInfo[PlayerB][Ballas] = 0;
            format(string, sizeof(string), "Vocк foi demitido por %s", demitidor);
            SendClientMessage(PlayerB, Branco, string);
            return 1;
        }
        return 1;
    }
if(strcmp(cmd, "/promover", true) == 0)
    {
        tmp = strtok(cmdtext, idx);
        new PlayerB, level;
        if(!strlen(tmp)) return SendClientMessage(playerid, Branco, "Uso correto: /promover [id] [cargo]");
        PlayerB = strval(tmp);
        if(!IsPlayerConnected(PlayerB)) return SendClientMessage(playerid, Branco, "Este jogador nгo estб conectado");
        tmp = strtok(cmdtext, idx);
        if(!strlen(tmp)) return SendClientMessage(playerid, Branco, "Uso correto: /promover [id] [cargo]");
        level = strval(tmp);
        if(level < 1 || level > 6) return SendClientMessage(playerid, Branco, "O level deve ser maior que 0 e menor que 7");
        new string[128], promovedor[MAX_PLAYER_NAME];
        GetPlayerName(playerid, promovedor, sizeof(promovedor));
        if(PlayerInfo[playerid][PMilitar] >= 6)
        {
            if(PlayerInfo[PlayerB][PMilitar] < 1) return SendClientMessage(playerid, Branco, "Este jogador nгo й da sua org");
            PlayerInfo[PlayerB][PMilitar] = level;
            format(string, sizeof(string), "Vocк foi promovido a level %d por %s", level, promovedor););
            SendClientMessage(PlayerB, Branco, string);
            return 1;
        }
        else if(PlayerInfo[playerid][Groove] >= 6)
        {
            if(PlayerInfo[PlayerB][Groove] < 1) return SendClientMessage(playerid, Branco, "Este jogador nгo й da sua org");
            PlayerInfo[PlayerB][Groove] = level;
            format(string, sizeof(string), "Vocк foi promovido a level %d por %s", level, promovedor););
            SendClientMessage(PlayerB, Branco, string);
            return 1;
        }
        else if(PlayerInfo[playerid][Ballas] >= 6)
        {
            if(PlayerInfo[PlayerB][Ballas] < 1) return SendClientMessage(playerid, Branco, "Este jogador nгo й da sua org");
            PlayerInfo[PlayerB][Ballas] = level;
            format(string, sizeof(string), "Vocк foi promovido a level %d por %s", level, promovedor););
            SendClientMessage(PlayerB, Branco, string);
            return 1;
        }
        return 1;
    }
    return 0;
}
Desta vez peguei manual do Josma:
https://sampforum.blast.hk/showthread.php?tid=270889

O manual ta muito bom, bem simples e tals, mas acredito que esses erros sejam por conta de fala ta de
pawn Код:
new
ou
#define
Ajudem ae :/
Reply
#2

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(strcmp(cmd, "/convidar", true) == 0)
    {
        tmp = strtok(cmdtext, idx);
        new PlayerB;
        if(!strlen(tmp)) return SendClientMessage(playerid, Branco, "Uso correto: /convidar [id]");
        PlayerB = strval(tmp);
        if(!IsPlayerConnected(PlayerB)) return SendClientMessage(playerid, Branco, "Este jogador nгo estб conectado");
        if(PlayerInfo[playerid][PMilitar] >= 6)
        {
            PlayerInfo[PlayerB][PMilitar] = 1;
            SendClientMessage(PlayerB, Branco, "Vocк entrou а Polнcia Militar");
            SetPlayerColor(PlayerB, Cor_PMilitar);
            return 1;
        }
        else if(PlayerInfo[playerid][Groove] >= 6)
        {
            PlayerInfo[PlayerB][Groove] = 1;
            SendClientMessage(PlayerB, Branco, "Vocк entrou а Groove");
            SetPlayerColor(PlayerB, Cor_Groove);
            return 1;
        }
        else if(PlayerInfo[playerid][Ballas] >= 6)
        {
            PlayerInfo[PlayerB][Ballas] = 1;
            SendClientMessage(PlayerB, Branco, "Vocк entrou aos Ballas");
            SetPlayerColor(PlayerB, Cor_Ballas);
            return 1;
        }
        return 1;
    }
    if(strcmp(cmd, "/demitir", true) == 0)
    {
        tmp = strtok(cmdtext, idx);
        new PlayerB, string[128], demitidor[MAX_PLAYER_NAME];
        if(!strlen(tmp)) return SendClientMessage(playerid, Branco, "Uso correto: /demitir [id]");
        PlayerB = strval(tmp);
        GetPlayerName(playerid, demitidor, sizeof(demitidor));
        if(!IsPlayerConnected(PlayerB)) return SendClientMessage(playerid, Branco, "Este jogador nгo estб conectado");
        if(PlayerInfo[playerid][PMilitar] >= 6)
        {
            if(PlayerInfo[PlayerB][PMilitar] < 1) return SendClientMessage(playerid, Branco, "Este jogador nгo й da sua organizaзгo");
            PlayerInfo[PlayerB][PMilitar] = 0;
            format(string, sizeof(string), "Vocк foi demitido por %s", demitidor);
            SendClientMessage(PlayerB, Branco, string);
            return 1;
        }
        else if(PlayerInfo[playerid][Groove] >= 6)
        {
            if(PlayerInfo[PlayerB][Groove] < 1) return SendClientMessage(playerid, Branco, "Este jogador nгo й da sua organizaзгo");
            PlayerInfo[PlayerB][Groove] = 0;
            format(string, sizeof(string), "Vocк foi demitido por %s", demitidor);
            SendClientMessage(PlayerB, Branco, string);
            return 1;
        }
        else if(PlayerInfo[playerid][Ballas] >= 6)
        {
            if(PlayerInfo[PlayerB][Ballas] < 1) return SendClientMessage(playerid, Branco, "Este jogador nгo й da sua organizaзгo");
            PlayerInfo[PlayerB][Ballas] = 0;
            format(string, sizeof(string), "Vocк foi demitido por %s", demitidor);
            SendClientMessage(PlayerB, Branco, string);
            return 1;
        }
        return 1;
    }
    if(strcmp(cmd, "/promover", true) == 0)
    {
        tmp = strtok(cmdtext, idx);
        new PlayerB, level;
        if(!strlen(tmp)) return SendClientMessage(playerid, Branco, "Uso correto: /promover [id] [cargo]");
        PlayerB = strval(tmp);
        if(!IsPlayerConnected(PlayerB)) return SendClientMessage(playerid, Branco, "Este jogador nгo estб conectado");
        tmp = strtok(cmdtext, idx);
        if(!strlen(tmp)) return SendClientMessage(playerid, Branco, "Uso correto: /promover [id] [cargo]");
        level = strval(tmp);
        if(level < 1 || level > 6) return SendClientMessage(playerid, Branco, "O level deve ser maior que 0 e menor que 7");
        new string[128], promovedor[MAX_PLAYER_NAME];
        GetPlayerName(playerid, promovedor, sizeof(promovedor));
        if(PlayerInfo[playerid][PMilitar] >= 6)
        {
            if(PlayerInfo[PlayerB][PMilitar] < 1) return SendClientMessage(playerid, Branco, "Este jogador nгo й da sua org");
            PlayerInfo[PlayerB][PMilitar] = level;
            format(string, sizeof(string), "Vocк foi promovido a level %d por %s", level, promovedor););
            SendClientMessage(PlayerB, Branco, string);
            return 1;
        }
        else if(PlayerInfo[playerid][Groove] >= 6)
        {
            if(PlayerInfo[PlayerB][Groove] < 1) return SendClientMessage(playerid, Branco, "Este jogador nгo й da sua org");
            PlayerInfo[PlayerB][Groove] = level;
            format(string, sizeof(string), "Vocк foi promovido a level %d por %s", level, promovedor););
            SendClientMessage(PlayerB, Branco, string);
            return 1;
        }
        else if(PlayerInfo[playerid][Ballas] >= 6)
        {
            if(PlayerInfo[PlayerB][Ballas] < 1) return SendClientMessage(playerid, Branco, "Este jogador nгo й da sua org");
            PlayerInfo[PlayerB][Ballas] = level;
            format(string, sizeof(string), "Vocк foi promovido a level %d por %s", level, promovedor););
            SendClientMessage(PlayerB, Branco, string);
            return 1;
        }
        return 1;
    }
    return 0;
}
Isso vai resolver alguns erros mas vai ter ainda outros, posta denovo com os erros que aparecerem.
Reply
#3

Quote:
Originally Posted by Pharrel
Посмотреть сообщение
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(strcmp(cmd, "/convidar", true) == 0)
    {
        tmp = strtok(cmdtext, idx);
        new PlayerB;
        if(!strlen(tmp)) return SendClientMessage(playerid, Branco, "Uso correto: /convidar [id]");
        PlayerB = strval(tmp);
        if(!IsPlayerConnected(PlayerB)) return SendClientMessage(playerid, Branco, "Este jogador nгo estб conectado");
        if(PlayerInfo[playerid][PMilitar] >= 6)
        {
            PlayerInfo[PlayerB][PMilitar] = 1;
            SendClientMessage(PlayerB, Branco, "Vocк entrou а Polнcia Militar");
            SetPlayerColor(PlayerB, Cor_PMilitar);
            return 1;
        }
        else if(PlayerInfo[playerid][Groove] >= 6)
        {
            PlayerInfo[PlayerB][Groove] = 1;
            SendClientMessage(PlayerB, Branco, "Vocк entrou а Groove");
            SetPlayerColor(PlayerB, Cor_Groove);
            return 1;
        }
        else if(PlayerInfo[playerid][Ballas] >= 6)
        {
            PlayerInfo[PlayerB][Ballas] = 1;
            SendClientMessage(PlayerB, Branco, "Vocк entrou aos Ballas");
            SetPlayerColor(PlayerB, Cor_Ballas);
            return 1;
        }
        return 1;
    }
    if(strcmp(cmd, "/demitir", true) == 0)
    {
        tmp = strtok(cmdtext, idx);
        new PlayerB, string[128], demitidor[MAX_PLAYER_NAME];
        if(!strlen(tmp)) return SendClientMessage(playerid, Branco, "Uso correto: /demitir [id]");
        PlayerB = strval(tmp);
        GetPlayerName(playerid, demitidor, sizeof(demitidor));
        if(!IsPlayerConnected(PlayerB)) return SendClientMessage(playerid, Branco, "Este jogador nгo estб conectado");
        if(PlayerInfo[playerid][PMilitar] >= 6)
        {
            if(PlayerInfo[PlayerB][PMilitar] < 1) return SendClientMessage(playerid, Branco, "Este jogador nгo й da sua organizaзгo");
            PlayerInfo[PlayerB][PMilitar] = 0;
            format(string, sizeof(string), "Vocк foi demitido por %s", demitidor);
            SendClientMessage(PlayerB, Branco, string);
            return 1;
        }
        else if(PlayerInfo[playerid][Groove] >= 6)
        {
            if(PlayerInfo[PlayerB][Groove] < 1) return SendClientMessage(playerid, Branco, "Este jogador nгo й da sua organizaзгo");
            PlayerInfo[PlayerB][Groove] = 0;
            format(string, sizeof(string), "Vocк foi demitido por %s", demitidor);
            SendClientMessage(PlayerB, Branco, string);
            return 1;
        }
        else if(PlayerInfo[playerid][Ballas] >= 6)
        {
            if(PlayerInfo[PlayerB][Ballas] < 1) return SendClientMessage(playerid, Branco, "Este jogador nгo й da sua organizaзгo");
            PlayerInfo[PlayerB][Ballas] = 0;
            format(string, sizeof(string), "Vocк foi demitido por %s", demitidor);
            SendClientMessage(PlayerB, Branco, string);
            return 1;
        }
        return 1;
    }
    if(strcmp(cmd, "/promover", true) == 0)
    {
        tmp = strtok(cmdtext, idx);
        new PlayerB, level;
        if(!strlen(tmp)) return SendClientMessage(playerid, Branco, "Uso correto: /promover [id] [cargo]");
        PlayerB = strval(tmp);
        if(!IsPlayerConnected(PlayerB)) return SendClientMessage(playerid, Branco, "Este jogador nгo estб conectado");
        tmp = strtok(cmdtext, idx);
        if(!strlen(tmp)) return SendClientMessage(playerid, Branco, "Uso correto: /promover [id] [cargo]");
        level = strval(tmp);
        if(level < 1 || level > 6) return SendClientMessage(playerid, Branco, "O level deve ser maior que 0 e menor que 7");
        new string[128], promovedor[MAX_PLAYER_NAME];
        GetPlayerName(playerid, promovedor, sizeof(promovedor));
        if(PlayerInfo[playerid][PMilitar] >= 6)
        {
            if(PlayerInfo[PlayerB][PMilitar] < 1) return SendClientMessage(playerid, Branco, "Este jogador nгo й da sua org");
            PlayerInfo[PlayerB][PMilitar] = level;
            format(string, sizeof(string), "Vocк foi promovido a level %d por %s", level, promovedor););
            SendClientMessage(PlayerB, Branco, string);
            return 1;
        }
        else if(PlayerInfo[playerid][Groove] >= 6)
        {
            if(PlayerInfo[PlayerB][Groove] < 1) return SendClientMessage(playerid, Branco, "Este jogador nгo й da sua org");
            PlayerInfo[PlayerB][Groove] = level;
            format(string, sizeof(string), "Vocк foi promovido a level %d por %s", level, promovedor););
            SendClientMessage(PlayerB, Branco, string);
            return 1;
        }
        else if(PlayerInfo[playerid][Ballas] >= 6)
        {
            if(PlayerInfo[PlayerB][Ballas] < 1) return SendClientMessage(playerid, Branco, "Este jogador nгo й da sua org");
            PlayerInfo[PlayerB][Ballas] = level;
            format(string, sizeof(string), "Vocк foi promovido a level %d por %s", level, promovedor););
            SendClientMessage(PlayerB, Branco, string);
            return 1;
        }
        return 1;
    }
    return 0;
}
Isso vai resolver alguns erros mas vai ter ainda outros, posta denovo com os erros que aparecerem.
pawn Код:
C:\Users\Cliente\Desktop\BGS.pwn(103) : error 017: undefined symbol "cmd"
C:\Users\Cliente\Desktop\BGS.pwn(105) : error 017: undefined symbol "tmp"
C:\Users\Cliente\Desktop\BGS.pwn(105) : error 017: undefined symbol "strtok"
C:\Users\Cliente\Desktop\BGS.pwn(107) : error 017: undefined symbol "tmp"
C:\Users\Cliente\Desktop\BGS.pwn(108) : error 017: undefined symbol "tmp"
C:\Users\Cliente\Desktop\BGS.pwn(133) : error 017: undefined symbol "cmd"
C:\Users\Cliente\Desktop\BGS.pwn(135) : error 017: undefined symbol "tmp"
C:\Users\Cliente\Desktop\BGS.pwn(135) : error 017: undefined symbol "strtok"
C:\Users\Cliente\Desktop\BGS.pwn(137) : error 017: undefined symbol "tmp"
C:\Users\Cliente\Desktop\BGS.pwn(138) : error 017: undefined symbol "tmp"
C:\Users\Cliente\Desktop\BGS.pwn(167) : error 017: undefined symbol "cmd"
C:\Users\Cliente\Desktop\BGS.pwn(169) : error 017: undefined symbol "tmp"
C:\Users\Cliente\Desktop\BGS.pwn(169) : error 017: undefined symbol "strtok"
C:\Users\Cliente\Desktop\BGS.pwn(171) : error 017: undefined symbol "tmp"
C:\Users\Cliente\Desktop\BGS.pwn(172) : error 017: undefined symbol "tmp"
C:\Users\Cliente\Desktop\BGS.pwn(174) : error 017: undefined symbol "tmp"
C:\Users\Cliente\Desktop\BGS.pwn(174) : error 017: undefined symbol "strtok"
C:\Users\Cliente\Desktop\BGS.pwn(175) : error 017: undefined symbol "tmp"
C:\Users\Cliente\Desktop\BGS.pwn(176) : error 017: undefined symbol "tmp"
C:\Users\Cliente\Desktop\BGS.pwn(184) : error 029: invalid expression, assumed zero
C:\Users\Cliente\Desktop\BGS.pwn(184) : warning 215: expression has no effect
C:\Users\Cliente\Desktop\BGS.pwn(192) : error 029: invalid expression, assumed zero
C:\Users\Cliente\Desktop\BGS.pwn(192) : warning 215: expression has no effect
C:\Users\Cliente\Desktop\BGS.pwn(200) : error 029: invalid expression, assumed zero
C:\Users\Cliente\Desktop\BGS.pwn(200) : warning 215: expression has no effect
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


22 Errors.
Reply
#4

pawn Код:
strtok(const string[], &index)
{
    new length = strlen(string);
    while ((index < length) && (string[index] <= ' ')) index++;
    new offset = index, result[20];
    while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
    {
        result[index - offset] = string[index];
        index++;
    }
    result[index - offset] = EOS;
    return result;
}
Poe isso no fim do GM e posta os outros erros.
Reply
#5

Quote:
Originally Posted by GustavoBonomo
Посмотреть сообщение
pawn Код:
C:\Users\Cliente\Desktop\BGS.pwn(103) : error 017: undefined symbol "cmd"
C:\Users\Cliente\Desktop\BGS.pwn(105) : error 017: undefined symbol "tmp"
C:\Users\Cliente\Desktop\BGS.pwn(105) : error 017: undefined symbol "strtok"
C:\Users\Cliente\Desktop\BGS.pwn(107) : error 017: undefined symbol "tmp"
C:\Users\Cliente\Desktop\BGS.pwn(108) : error 017: undefined symbol "tmp"
C:\Users\Cliente\Desktop\BGS.pwn(133) : error 017: undefined symbol "cmd"
C:\Users\Cliente\Desktop\BGS.pwn(135) : error 017: undefined symbol "tmp"
C:\Users\Cliente\Desktop\BGS.pwn(135) : error 017: undefined symbol "strtok"
C:\Users\Cliente\Desktop\BGS.pwn(137) : error 017: undefined symbol "tmp"
C:\Users\Cliente\Desktop\BGS.pwn(138) : error 017: undefined symbol "tmp"
C:\Users\Cliente\Desktop\BGS.pwn(167) : error 017: undefined symbol "cmd"
C:\Users\Cliente\Desktop\BGS.pwn(169) : error 017: undefined symbol "tmp"
C:\Users\Cliente\Desktop\BGS.pwn(169) : error 017: undefined symbol "strtok"
C:\Users\Cliente\Desktop\BGS.pwn(171) : error 017: undefined symbol "tmp"
C:\Users\Cliente\Desktop\BGS.pwn(172) : error 017: undefined symbol "tmp"
C:\Users\Cliente\Desktop\BGS.pwn(174) : error 017: undefined symbol "tmp"
C:\Users\Cliente\Desktop\BGS.pwn(174) : error 017: undefined symbol "strtok"
C:\Users\Cliente\Desktop\BGS.pwn(175) : error 017: undefined symbol "tmp"
C:\Users\Cliente\Desktop\BGS.pwn(176) : error 017: undefined symbol "tmp"
C:\Users\Cliente\Desktop\BGS.pwn(184) : error 029: invalid expression, assumed zero
C:\Users\Cliente\Desktop\BGS.pwn(184) : warning 215: expression has no effect
C:\Users\Cliente\Desktop\BGS.pwn(192) : error 029: invalid expression, assumed zero
C:\Users\Cliente\Desktop\BGS.pwn(192) : warning 215: expression has no effect
C:\Users\Cliente\Desktop\BGS.pwn(200) : error 029: invalid expression, assumed zero
C:\Users\Cliente\Desktop\BGS.pwn(200) : warning 215: expression has no effect
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


22 Errors.

Isto deve resolver o seu problema :


Troque sua public OnPlayerCommandText por esta :

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    new cmd[128];
    new tmp[128];
    new idx;
    cmd = strtok(cmdtext, idx);
    if(strcmp(cmd, "/convidar", true) == 0)
    {
        tmp = strtok(cmdtext, idx);
        new PlayerB;
        if(!strlen(tmp)) return SendClientMessage(playerid, Branco, "Uso correto: /convidar [id]");
        PlayerB = strval(tmp);
        if(!IsPlayerConnected(PlayerB)) return SendClientMessage(playerid, Branco, "Este jogador nгo estб conectado");
        if(PlayerInfo[playerid][PMilitar] >= 6)
        {
            PlayerInfo[PlayerB][PMilitar] = 1;
            SendClientMessage(PlayerB, Branco, "Vocк entrou а Polнcia Militar");
            SetPlayerColor(PlayerB, Cor_PMilitar);
            return 1;
        }
        else if(PlayerInfo[playerid][Groove] >= 6)
        {
            PlayerInfo[PlayerB][Groove] = 1;
            SendClientMessage(PlayerB, Branco, "Vocк entrou а Groove");
            SetPlayerColor(PlayerB, Cor_Groove);
            return 1;
        }
        else if(PlayerInfo[playerid][Ballas] >= 6)
        {
            PlayerInfo[PlayerB][Ballas] = 1;
            SendClientMessage(PlayerB, Branco, "Vocк entrou aos Ballas");
            SetPlayerColor(PlayerB, Cor_Ballas);
            return 1;
        }
        return 1;
    }
    if(strcmp(cmd, "/demitir", true) == 0)
    {
        tmp = strtok(cmdtext, idx);
        new PlayerB, string[128], demitidor[MAX_PLAYER_NAME];
        if(!strlen(tmp)) return SendClientMessage(playerid, Branco, "Uso correto: /demitir [id]");
        PlayerB = strval(tmp);
        GetPlayerName(playerid, demitidor, sizeof(demitidor));
        if(!IsPlayerConnected(PlayerB)) return SendClientMessage(playerid, Branco, "Este jogador nгo estб conectado");
        if(PlayerInfo[playerid][PMilitar] >= 6)
        {
            if(PlayerInfo[PlayerB][PMilitar] < 1) return SendClientMessage(playerid, Branco, "Este jogador nгo й da sua organizaзгo");
            PlayerInfo[PlayerB][PMilitar] = 0;
            format(string, sizeof(string), "Vocк foi demitido por %s", demitidor);
            SendClientMessage(PlayerB, Branco, string);
            return 1;
        }
        else if(PlayerInfo[playerid][Groove] >= 6)
        {
            if(PlayerInfo[PlayerB][Groove] < 1) return SendClientMessage(playerid, Branco, "Este jogador nгo й da sua organizaзгo");
            PlayerInfo[PlayerB][Groove] = 0;
            format(string, sizeof(string), "Vocк foi demitido por %s", demitidor);
            SendClientMessage(PlayerB, Branco, string);
            return 1;
        }
        else if(PlayerInfo[playerid][Ballas] >= 6)
        {
            if(PlayerInfo[PlayerB][Ballas] < 1) return SendClientMessage(playerid, Branco, "Este jogador nгo й da sua organizaзгo");
            PlayerInfo[PlayerB][Ballas] = 0;
            format(string, sizeof(string), "Vocк foi demitido por %s", demitidor);
            SendClientMessage(PlayerB, Branco, string);
            return 1;
        }
        return 1;
    }
    if(strcmp(cmd, "/promover", true) == 0)
    {
        tmp = strtok(cmdtext, idx);
        new PlayerB, level;
        if(!strlen(tmp)) return SendClientMessage(playerid, Branco, "Uso correto: /promover [id] [cargo]");
        PlayerB = strval(tmp);
        if(!IsPlayerConnected(PlayerB)) return SendClientMessage(playerid, Branco, "Este jogador nгo estб conectado");
        tmp = strtok(cmdtext, idx);
        if(!strlen(tmp)) return SendClientMessage(playerid, Branco, "Uso correto: /promover [id] [cargo]");
        level = strval(tmp);
        if(level < 1 || level > 6) return SendClientMessage(playerid, Branco, "O level deve ser maior que 0 e menor que 7");
        new string[128], promovedor[MAX_PLAYER_NAME];
        GetPlayerName(playerid, promovedor, sizeof(promovedor));
        if(PlayerInfo[playerid][PMilitar] >= 6)
        {
            if(PlayerInfo[PlayerB][PMilitar] < 1) return SendClientMessage(playerid, Branco, "Este jogador nгo й da sua org");
            PlayerInfo[PlayerB][PMilitar] = level;
            format(string, sizeof(string), "Vocк foi promovido a level %d por %s", level, promovedor);
            SendClientMessage(PlayerB, Branco, string);
            return 1;
        }
        else if(PlayerInfo[playerid][Groove] >= 6)
        {
            if(PlayerInfo[PlayerB][Groove] < 1) return SendClientMessage(playerid, Branco, "Este jogador nгo й da sua org");
            PlayerInfo[PlayerB][Groove] = level;
            format(string, sizeof(string), "Vocк foi promovido a level %d por %s", level, promovedor);
            SendClientMessage(PlayerB, Branco, string);
            return 1;
        }
        else if(PlayerInfo[playerid][Ballas] >= 6)
        {
            if(PlayerInfo[PlayerB][Ballas] < 1) return SendClientMessage(playerid, Branco, "Este jogador nгo й da sua org");
            PlayerInfo[PlayerB][Ballas] = level;
            format(string, sizeof(string), "Vocк foi promovido a level %d por %s", level, promovedor);
            SendClientMessage(PlayerB, Branco, string);
            return 1;
        }
        return 1;
    }
    return 0;
}


E depois coloque no Final do GM :

pawn Код:
stock 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;
}


Espero ter ajudado .
Reply
#6

Quote:
Originally Posted by Pharrel
Посмотреть сообщение
pawn Код:
strtok(const string[], &index)
{
    new length = strlen(string);
    while ((index < length) && (string[index] <= ' ')) index++;
    new offset = index, result[20];
    while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
    {
        result[index - offset] = string[index];
        index++;
    }
    result[index - offset] = EOS;
    return result;
}
Poe isso no fim do GM e posta os outros erros.
Coloquei no final do GM e num mudou nada :/
Reply
#7

Olha, se vc ta comeзando um GM do 0, eu te aconselho a usar sscanf, Strtok nгo й seguro alйm de ser lento entre outros problemas...


@edit

Sua OnPlayerCommandText em sscanf
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    new cmd[50 char], params[100 char], PlayerB;
    unformat(cmdtext, "s[50]S( )[100]",cmd,params);
    if(strcmp(cmd, "/convidar", true) == 0)
    {
        if(sscanf(params, "u", PlayerB)) return SendClientMessage(playerid, -1, "Uso correto: /convidar [id]");
        if(!IsPlayerConnected(PlayerB)) return SendClientMessage(playerid, Branco, "Este jogador nгo estб conectado");
        if(PlayerInfo[playerid][PMilitar] >= 6)
        {
            PlayerInfo[PlayerB][PMilitar] = 1;
            SendClientMessage(PlayerB, Branco, "Vocк entrou а Polнcia Militar");
            SetPlayerColor(PlayerB, Cor_PMilitar);
            return 1;
        }
        else if(PlayerInfo[playerid][Groove] >= 6)
        {
            PlayerInfo[PlayerB][Groove] = 1;
            SendClientMessage(PlayerB, Branco, "Vocк entrou а Groove");
            SetPlayerColor(PlayerB, Cor_Groove);
            return 1;
        }
        else if(PlayerInfo[playerid][Ballas] >= 6)
        {
            PlayerInfo[PlayerB][Ballas] = 1;
            SendClientMessage(PlayerB, Branco, "Vocк entrou aos Ballas");
            SetPlayerColor(PlayerB, Cor_Ballas);
            return 1;
        }
        return 1;
    }
    if(strcmp(cmd, "/demitir", true) == 0)
    {
        if(sscanf(params, "u", PlayerB)) return SendClientMessage(playerid, -1, "Uso correto: /demitir [id]");
        new string[47];
        GetPlayerName(playerid, string, 24);
        if(!IsPlayerConnected(PlayerB)) return SendClientMessage(playerid, Branco, "Este jogador nгo estб conectado");
        if(PlayerInfo[playerid][PMilitar] >= 6)
        {
            if(PlayerInfo[PlayerB][PMilitar] < 1) return SendClientMessage(playerid, Branco, "Este jogador nгo й da sua organizaзгo");
            PlayerInfo[PlayerB][PMilitar] = 0;
            format(string, sizeof(string), "Vocк foi demitido por %s", string);
            SendClientMessage(PlayerB, Branco, string);
            return 1;
        }
        else if(PlayerInfo[playerid][Groove] >= 6)
        {
            if(PlayerInfo[PlayerB][Groove] < 1) return SendClientMessage(playerid, Branco, "Este jogador nгo й da sua organizaзгo");
            PlayerInfo[PlayerB][Groove] = 0;
            format(string, sizeof(string), "Vocк foi demitido por %s", string);
            SendClientMessage(PlayerB, Branco, string);
            return 1;
        }
        else if(PlayerInfo[playerid][Ballas] >= 6)
        {
            if(PlayerInfo[PlayerB][Ballas] < 1) return SendClientMessage(playerid, Branco, "Este jogador nгo й da sua organizaзгo");
            PlayerInfo[PlayerB][Ballas] = 0;
            format(string, sizeof(string), "Vocк foi demitido por %s", string);
            SendClientMessage(PlayerB, Branco, string);
            return 1;
        }
        return 1;
    }
    if(strcmp(cmd, "/promover", true) == 0)
    {
        new level;
        if(sscanf(params, "ud", PlayerB, level))
            return SendClientMessage(playerid, -1, "Uso correto: /promover [id] [cargo]");
        if(level < 1 || level > 6) return SendClientMessage(playerid, Branco, "O level deve ser maior que 0 e menor que 7");
        new string[58];
        GetPlayerName(playerid, string, 24);
        if(PlayerInfo[playerid][PMilitar] >= 6)
        {
            if(PlayerInfo[PlayerB][PMilitar] < 1) return SendClientMessage(playerid, Branco, "Este jogador nгo й da sua org");
            PlayerInfo[PlayerB][PMilitar] = level;
            format(string, sizeof(string), "Vocк foi promovido a level %d por %s", level, string););
            SendClientMessage(PlayerB, Branco, string);
            return 1;
        }
        else if(PlayerInfo[playerid][Groove] >= 6)
        {
            if(PlayerInfo[PlayerB][Groove] < 1) return SendClientMessage(playerid, Branco, "Este jogador nгo й da sua org");
            PlayerInfo[PlayerB][Groove] = level;
            format(string, sizeof(string), "Vocк foi promovido a level %d por %s", level, string););
            SendClientMessage(PlayerB, Branco, string);
            return 1;
        }
        else if(PlayerInfo[playerid][Ballas] >= 6)
        {
            if(PlayerInfo[PlayerB][Ballas] < 1) return SendClientMessage(playerid, Branco, "Este jogador nгo й da sua org");
            PlayerInfo[PlayerB][Ballas] = level;
            format(string, sizeof(string), "Vocк foi promovido a level %d por %s", level, string););
            SendClientMessage(PlayerB, Branco, string);
            return 1;
        }
        return 1;
    }
    return 0;
}
Se quiser usar desse jeito tera que instalar o plugin sscanf

Se usar sscanf e tiver qualquer duvida sinta-se а vontade pra me enviar MP's.

@edit2

Tutorial de como usar sscanf a unica diferenзa й que nesse tutorial mostra usando ZCMD, mas nгo tem muita diferenзa (EM FORMA DE USO NГO OPTIMIZAЗГO) ZCMD pra strcmp, por exemplo:

if(!strcmp(cmd, "/dar", true))
CMD:dar(playerid, params)

ambos sгo iguais com 2 formas diferentes.
Reply
#8

Quote:
Originally Posted by Pharrel
Посмотреть сообщение
Olha, se vc ta comeзando um GM do 0, eu te aconselho a usar sscanf, Strtok nгo й seguro alйm de ser lento entre outros problemas...


@edit

Sua OnPlayerCommandText em sscanf
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    new cmd[50 char], params[100 char], PlayerB;
    unformat(cmdtext, "s[50]S( )[100]",cmd,params);
    if(strcmp(cmd, "/convidar", true) == 0)
    {
        if(sscanf(params, "u", PlayerB)) return SendClientMessage(playerid, -1, "Uso correto: /convidar [id]");
        if(!IsPlayerConnected(PlayerB)) return SendClientMessage(playerid, Branco, "Este jogador nгo estб conectado");
        if(PlayerInfo[playerid][PMilitar] >= 6)
        {
            PlayerInfo[PlayerB][PMilitar] = 1;
            SendClientMessage(PlayerB, Branco, "Vocк entrou а Polнcia Militar");
            SetPlayerColor(PlayerB, Cor_PMilitar);
            return 1;
        }
        else if(PlayerInfo[playerid][Groove] >= 6)
        {
            PlayerInfo[PlayerB][Groove] = 1;
            SendClientMessage(PlayerB, Branco, "Vocк entrou а Groove");
            SetPlayerColor(PlayerB, Cor_Groove);
            return 1;
        }
        else if(PlayerInfo[playerid][Ballas] >= 6)
        {
            PlayerInfo[PlayerB][Ballas] = 1;
            SendClientMessage(PlayerB, Branco, "Vocк entrou aos Ballas");
            SetPlayerColor(PlayerB, Cor_Ballas);
            return 1;
        }
        return 1;
    }
    if(strcmp(cmd, "/demitir", true) == 0)
    {
        if(sscanf(params, "u", PlayerB)) return SendClientMessage(playerid, -1, "Uso correto: /demitir [id]");
        new string[47];
        GetPlayerName(playerid, string, 24);
        if(!IsPlayerConnected(PlayerB)) return SendClientMessage(playerid, Branco, "Este jogador nгo estб conectado");
        if(PlayerInfo[playerid][PMilitar] >= 6)
        {
            if(PlayerInfo[PlayerB][PMilitar] < 1) return SendClientMessage(playerid, Branco, "Este jogador nгo й da sua organizaзгo");
            PlayerInfo[PlayerB][PMilitar] = 0;
            format(string, sizeof(string), "Vocк foi demitido por %s", string);
            SendClientMessage(PlayerB, Branco, string);
            return 1;
        }
        else if(PlayerInfo[playerid][Groove] >= 6)
        {
            if(PlayerInfo[PlayerB][Groove] < 1) return SendClientMessage(playerid, Branco, "Este jogador nгo й da sua organizaзгo");
            PlayerInfo[PlayerB][Groove] = 0;
            format(string, sizeof(string), "Vocк foi demitido por %s", string);
            SendClientMessage(PlayerB, Branco, string);
            return 1;
        }
        else if(PlayerInfo[playerid][Ballas] >= 6)
        {
            if(PlayerInfo[PlayerB][Ballas] < 1) return SendClientMessage(playerid, Branco, "Este jogador nгo й da sua organizaзгo");
            PlayerInfo[PlayerB][Ballas] = 0;
            format(string, sizeof(string), "Vocк foi demitido por %s", string);
            SendClientMessage(PlayerB, Branco, string);
            return 1;
        }
        return 1;
    }
    if(strcmp(cmd, "/promover", true) == 0)
    {
        new level;
        if(sscanf(params, "ud", PlayerB, level))
            return SendClientMessage(playerid, -1, "Uso correto: /promover [id] [cargo]");
        if(level < 1 || level > 6) return SendClientMessage(playerid, Branco, "O level deve ser maior que 0 e menor que 7");
        new string[58];
        GetPlayerName(playerid, string, 24);
        if(PlayerInfo[playerid][PMilitar] >= 6)
        {
            if(PlayerInfo[PlayerB][PMilitar] < 1) return SendClientMessage(playerid, Branco, "Este jogador nгo й da sua org");
            PlayerInfo[PlayerB][PMilitar] = level;
            format(string, sizeof(string), "Vocк foi promovido a level %d por %s", level, string););
            SendClientMessage(PlayerB, Branco, string);
            return 1;
        }
        else if(PlayerInfo[playerid][Groove] >= 6)
        {
            if(PlayerInfo[PlayerB][Groove] < 1) return SendClientMessage(playerid, Branco, "Este jogador nгo й da sua org");
            PlayerInfo[PlayerB][Groove] = level;
            format(string, sizeof(string), "Vocк foi promovido a level %d por %s", level, string););
            SendClientMessage(PlayerB, Branco, string);
            return 1;
        }
        else if(PlayerInfo[playerid][Ballas] >= 6)
        {
            if(PlayerInfo[PlayerB][Ballas] < 1) return SendClientMessage(playerid, Branco, "Este jogador nгo й da sua org");
            PlayerInfo[PlayerB][Ballas] = level;
            format(string, sizeof(string), "Vocк foi promovido a level %d por %s", level, string););
            SendClientMessage(PlayerB, Branco, string);
            return 1;
        }
        return 1;
    }
    return 0;
}
Se quiser usar desse jeito tera que instalar o plugin sscanf

Se usar sscanf e tiver qualquer duvida sinta-se а vontade pra me enviar MP's.

@edit2

Tutorial de como usar sscanf a unica diferenзa й que nesse tutorial mostra usando ZCMD, mas nгo tem muita diferenзa (EM FORMA DE USO NГO OPTIMIZAЗГO) ZCMD pra strcmp, por exemplo:

if(!strcmp(cmd, "/dar", true))
CMD:dar(playerid, params)

ambos sгo iguais com 2 formas diferentes.
DEU ALGUNS ERROS:
pawn Код:
C:\Users\Cliente\Desktop\Brasil Games Street.pwn(13) : error 017: undefined symbol "Info"
C:\Users\Cliente\Desktop\Brasil Games Street.pwn(13) : error 009: invalid array size (negative, zero or out of bounds)
C:\Users\Cliente\Desktop\Brasil Games Street.pwn(112) : warning 213: tag mismatch
C:\Users\Cliente\Desktop\Brasil Games Street.pwn(114) : warning 213: tag mismatch
C:\Users\Cliente\Desktop\Brasil Games Street.pwn(119) : warning 213: tag mismatch
C:\Users\Cliente\Desktop\Brasil Games Street.pwn(121) : warning 213: tag mismatch
C:\Users\Cliente\Desktop\Brasil Games Street.pwn(126) : warning 213: tag mismatch
C:\Users\Cliente\Desktop\Brasil Games Street.pwn(128) : warning 213: tag mismatch
C:\Users\Cliente\Desktop\Brasil Games Street.pwn(141) : warning 213: tag mismatch
C:\Users\Cliente\Desktop\Brasil Games Street.pwn(143) : warning 213: tag mismatch
C:\Users\Cliente\Desktop\Brasil Games Street.pwn(144) : warning 213: tag mismatch
C:\Users\Cliente\Desktop\Brasil Games Street.pwn(149) : warning 213: tag mismatch
C:\Users\Cliente\Desktop\Brasil Games Street.pwn(151) : warning 213: tag mismatch
C:\Users\Cliente\Desktop\Brasil Games Street.pwn(152) : warning 213: tag mismatch
C:\Users\Cliente\Desktop\Brasil Games Street.pwn(157) : warning 213: tag mismatch
C:\Users\Cliente\Desktop\Brasil Games Street.pwn(159) : warning 213: tag mismatch
C:\Users\Cliente\Desktop\Brasil Games Street.pwn(160) : warning 213: tag mismatch
C:\Users\Cliente\Desktop\Brasil Games Street.pwn(175) : warning 213: tag mismatch
C:\Users\Cliente\Desktop\Brasil Games Street.pwn(177) : warning 213: tag mismatch
C:\Users\Cliente\Desktop\Brasil Games Street.pwn(178) : warning 213: tag mismatch
C:\Users\Cliente\Desktop\Brasil Games Street.pwn(179) : error 029: invalid expression, assumed zero
C:\Users\Cliente\Desktop\Brasil Games Street.pwn(179) : warning 215: expression has no effect
C:\Users\Cliente\Desktop\Brasil Games Street.pwn(183) : warning 213: tag mismatch
C:\Users\Cliente\Desktop\Brasil Games Street.pwn(185) : warning 213: tag mismatch
C:\Users\Cliente\Desktop\Brasil Games Street.pwn(186) : warning 213: tag mismatch
C:\Users\Cliente\Desktop\Brasil Games Street.pwn(187) : error 029: invalid expression, assumed zero
C:\Users\Cliente\Desktop\Brasil Games Street.pwn(187) : warning 215: expression has no effect
C:\Users\Cliente\Desktop\Brasil Games Street.pwn(191) : warning 213: tag mismatch
C:\Users\Cliente\Desktop\Brasil Games Street.pwn(193) : warning 213: tag mismatch
C:\Users\Cliente\Desktop\Brasil Games Street.pwn(194) : warning 213: tag mismatch
C:\Users\Cliente\Desktop\Brasil Games Street.pwn(195) : error 029: invalid expression, assumed zero
C:\Users\Cliente\Desktop\Brasil Games Street.pwn(195) : warning 215: expression has no effect
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


5 Errors.
LINHA PROBLEMA:
pawn Код:
new PlayerInfo[MAX_PLAYERS][Info];
Reply
#9

Ajudem please
Reply
#10

pawn Код:
#include <a_samp>

enum pInfo
{
    Groove,
    Ballas,
    PMilitar
};

new PlayerInfo[MAX_PLAYERS][pInfo];

public OnPlayerCommandText(playerid, cmdtext[])
{
    new cmd[128];
    new tmp[128];
    new idx;
    cmd = strtok(cmdtext, idx);
    if(strcmp(cmd, "/convidar", true) == 0)
    {
        tmp = strtok(cmdtext, idx);
        new PlayerB;
        if(!strlen(tmp)) return SendClientMessage(playerid, -1, "Uso correto: /convidar [id]");
        PlayerB = strval(tmp);
        if(!IsPlayerConnected(PlayerB)) return SendClientMessage(playerid, -1, "Este jogador nгo estб conectado");
        if(PlayerInfo[playerid][PMilitar] >= 6)
        {
            PlayerInfo[PlayerB][PMilitar] = 1;
            SendClientMessage(PlayerB, -1, "Vocк entrou а Polнcia Militar");
            SetPlayerColor(PlayerB, -1);
            return 1;
        }
        else if(PlayerInfo[playerid][Groove] >= 6)
        {
            PlayerInfo[PlayerB][Groove] = 1;
            SendClientMessage(PlayerB, -1, "Vocк entrou а Groove");
            SetPlayerColor(PlayerB, -1);
            return 1;
        }
        else if(PlayerInfo[playerid][Ballas] >= 6)
        {
            PlayerInfo[PlayerB][Ballas] = 1;
            SendClientMessage(PlayerB, -1, "Vocк entrou aos Ballas");
            SetPlayerColor(PlayerB, -1);
            return 1;
        }
        return 1;
    }
    if(strcmp(cmd, "/demitir", true) == 0)
    {
        tmp = strtok(cmdtext, idx);
        new PlayerB, string[128], demitidor[MAX_PLAYER_NAME];
        if(!strlen(tmp)) return SendClientMessage(playerid, -1, "Uso correto: /demitir [id]");
        PlayerB = strval(tmp);
        GetPlayerName(playerid, demitidor, sizeof(demitidor));
        if(!IsPlayerConnected(PlayerB)) return SendClientMessage(playerid, -1, "Este jogador nгo estб conectado");
        if(PlayerInfo[playerid][PMilitar] >= 6)
        {
            if(PlayerInfo[PlayerB][PMilitar] < 1) return SendClientMessage(playerid, -1, "Este jogador nгo й da sua organizaзгo");
            PlayerInfo[PlayerB][PMilitar] = 0;
            format(string, sizeof(string), "Vocк foi demitido por %s", demitidor);
            SendClientMessage(PlayerB, -1, string);
            return 1;
        }
        else if(PlayerInfo[playerid][Groove] >= 6)
        {
            if(PlayerInfo[PlayerB][Groove] < 1) return SendClientMessage(playerid, -1, "Este jogador nгo й da sua organizaзгo");
            PlayerInfo[PlayerB][Groove] = 0;
            format(string, sizeof(string), "Vocк foi demitido por %s", demitidor);
            SendClientMessage(PlayerB, -1, string);
            return 1;
        }
        else if(PlayerInfo[playerid][Ballas] >= 6)
        {
            if(PlayerInfo[PlayerB][Ballas] < 1) return SendClientMessage(playerid, -1, "Este jogador nгo й da sua organizaзгo");
            PlayerInfo[PlayerB][Ballas] = 0;
            format(string, sizeof(string), "Vocк foi demitido por %s", demitidor);
            SendClientMessage(PlayerB, -1, string);
            return 1;
        }
        return 1;
    }
    if(strcmp(cmd, "/promover", true) == 0)
    {
        tmp = strtok(cmdtext, idx);
        new PlayerB, level;
        if(!strlen(tmp)) return SendClientMessage(playerid, -1, "Uso correto: /promover [id] [cargo]");
        PlayerB = strval(tmp);
        if(!IsPlayerConnected(PlayerB)) return SendClientMessage(playerid, -1, "Este jogador nгo estб conectado");
        tmp = strtok(cmdtext, idx);
        if(!strlen(tmp)) return SendClientMessage(playerid, -1, "Uso correto: /promover [id] [cargo]");
        level = strval(tmp);
        if(level < 1 || level > 6) return SendClientMessage(playerid, -1, "O level deve ser maior que 0 e menor que 7");
        new string[128], promovedor[MAX_PLAYER_NAME];
        GetPlayerName(playerid, promovedor, sizeof(promovedor));
        if(PlayerInfo[playerid][PMilitar] >= 6)
        {
            if(PlayerInfo[PlayerB][PMilitar] < 1) return SendClientMessage(playerid, -1, "Este jogador nгo й da sua org");
            PlayerInfo[PlayerB][PMilitar] = level;
            format(string, sizeof(string), "Vocк foi promovido a level %d por %s", level, promovedor);
            SendClientMessage(PlayerB, -1, string);
            return 1;
        }
        else if(PlayerInfo[playerid][Groove] >= 6)
        {
            if(PlayerInfo[PlayerB][Groove] < 1) return SendClientMessage(playerid, -1, "Este jogador nгo й da sua org");
            PlayerInfo[PlayerB][Groove] = level;
            format(string, sizeof(string), "Vocк foi promovido a level %d por %s", level, promovedor);
            SendClientMessage(PlayerB, -1, string);
            return 1;
        }
        else if(PlayerInfo[playerid][Ballas] >= 6)
        {
            if(PlayerInfo[PlayerB][Ballas] < 1) return SendClientMessage(playerid, -1, "Este jogador nгo й da sua org");
            PlayerInfo[PlayerB][Ballas] = level;
            format(string, sizeof(string), "Vocк foi promovido a level %d por %s", level, promovedor);
            SendClientMessage(PlayerB, -1, string);
            return 1;
        }
        return 1;
    }
    return 0;
}

stock 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;
}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)