[AJUDA] Orgs
#1

Olб, sou novato e nгo sei codar ainda muito bem o Pawn. Preciso de uma pequena ajuda, sгo coisas simples; porйm nгo estou conseguindo idenficar o erro, estou usando o gamemode do DJ_Bruninho como base para apredizado.

Me ajudem ai;

PHP код:
public OnPlayerCommandText(playeridcmdtext[])
{
        new 
PlayerB;
        new 
string[128];
        new 
cmd[128];
        new 
tmp[128];
        if(
strcmp(cmd"/convidar"true) == 0)
            {
                
                if(!
strlen(tmp)) return SendClientMessage(playerBBRANCO2"Uso correto: /convidar [id]");
                
PlayerB strval(tmp);
                if(!
IsPlayerConnected(PlayerB)) return SendClientMessage(playeridBRANCO2"Este jogador nгo estб conectado");
                if(
BrunoInfo[playerid][PM] >= 6)
                {
                    
BrunoInfo[playerid][PM] = 1;
                     
SendClientMessage(playeridBRANCO2"Vocк entrou para a Polнcia Militar");
                       
SetPlayerColor(playeridCOR_PM);
                       return 
1;
                }
                return 
1;

Reply
#2

Fica mais fбcil vocк dizer o que acontece...
Dб erro ao compilar? Comando nгo funciona? O que acontece?
Reply
#3

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
        new PlayerB;
        new string[128];
        new cmd[128];
        new tmp[128];
        if(strcmp(cmd, "/convidar", true) == 0)
        {
            tmp = strtok(cmdtext,idx)
            if(!strlen(tmp)) return SendClientMessage(playerB, BRANCO2, "Uso correto: /convidar [id]");
            PlayerB = strval(tmp);
            if(!IsPlayerConnected(PlayerB)) return SendClientMessage(playerid, BRANCO2, "Este jogador nгo estб conectado");
            if(BrunoInfo[playerid][PM] >= 6)
            {
                BrunoInfo[playerid][PM] = 1;
                SendClientMessage(playerid, BRANCO2, "Vocк entrou para a Polнcia Militar");
                SetPlayerColor(playerid, COR_PM);
                return 1;
            }
            return 1;
        }
@EDIT tenta assim, e fala qual й o erro. '-'
Reply
#4

pawn Код:
C:\Users\SHIELD\Desktop\Brasil StyleGames RPG\gamemodes\BSG.pwn(6323) : error 001: expected token: "-identifier-", but found ";"
C:\Users\SHIELD\Desktop\Brasil StyleGames RPG\gamemodes\BSG.pwn(6330) : error 017: undefined symbol "playerB"
C:\Users\SHIELD\Desktop\Brasil StyleGames RPG\gamemodes\BSG.pwn(6331) : warning 217: loose indentation
C:\Users\SHIELD\Desktop\Brasil StyleGames RPG\gamemodes\BSG.pwn(6331) : error 029: invalid expression, assumed zero
C:\Users\SHIELD\Desktop\Brasil StyleGames RPG\gamemodes\BSG.pwn(6332) : warning 217: loose indentation
C:\Users\SHIELD\Desktop\Brasil StyleGames RPG\gamemodes\BSG.pwn(6332) : warning 202: number of arguments does not match definition
C:\Users\SHIELD\Desktop\Brasil StyleGames RPG\gamemodes\BSG.pwn(6332) : error 035: argument type mismatch (argument 2)
C:\Users\SHIELD\Desktop\Brasil StyleGames RPG\gamemodes\BSG.pwn(6333) : warning 213: tag mismatch
C:\Users\SHIELD\Desktop\Brasil StyleGames RPG\gamemodes\BSG.pwn(6335) : warning 213: tag mismatch
C:\Users\SHIELD\Desktop\Brasil StyleGames RPG\gamemodes\BSG.pwn(6336) : error 035: argument type mismatch (argument 2)
C:\Users\SHIELD\Desktop\Brasil StyleGames RPG\gamemodes\BSG.pwn(6337) : error 035: argument type mismatch (argument 2)
C:\Users\SHIELD\Desktop\Brasil StyleGames RPG\gamemodes\BSG.pwn(6342) : warning 217: loose indentation
C:\Users\SHIELD\Desktop\Brasil StyleGames RPG\gamemodes\BSG.pwn(6342) : error 017: undefined symbol "strtok"
C:\Users\SHIELD\Desktop\Brasil StyleGames RPG\gamemodes\BSG.pwn(6342 -- 6365) : warning 215: expression has no effect
C:\Users\SHIELD\Desktop\Brasil StyleGames RPG\gamemodes\BSG.pwn(6365) : error 001: expected token: ";", but found "-end of file-"
Reply
#5

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
        new PlayerB;
        new string[128];
        new cmd[128];
        new tmp[128];
        if(strcmp(cmd, "/convidar", true) == 0)
        {
            tmp = strtok(cmdtext,idx)
            if(!strlen(tmp)) return SendClientMessage(playerid, BRANCO2, "Uso correto: /convidar [id]");
            PlayerB = strval(tmp);
            if(!IsPlayerConnected(PlayerB)) return SendClientMessage(playerid, BRANCO2, "Este jogador nгo estб conectado");
            if(BrunoInfo[playerid][PM] >= 6)
            {
                BrunoInfo[PlayerB][PM] = 1;
                SendClientMessage(PlayerB, BRANCO2, "Vocк entrou para a Polнcia Militar");
                SetPlayerColor(PlayerB, COR_PM);
                return 1;
            }
            return 1;
        }
Acho que assim deve resolver
Reply
#6

Willian, usando o seu deu 5 erros.

pawn Код:
C:\Users\SHIELD\Desktop\Brasil StyleGames RPG\gamemodes\BSG.pwn(6323) : error 001: expected token: "-identifier-", but found ";"
C:\Users\SHIELD\Desktop\Brasil StyleGames RPG\gamemodes\BSG.pwn(6329) : error 017: undefined symbol "strtok"
C:\Users\SHIELD\Desktop\Brasil StyleGames RPG\gamemodes\BSG.pwn(6329) : error 033: array must be indexed (variable "tmp")
C:\Users\SHIELD\Desktop\Brasil StyleGames RPG\gamemodes\BSG.pwn(6329) : error 035: argument type mismatch (argument 2)
C:\Users\SHIELD\Desktop\Brasil StyleGames RPG\gamemodes\BSG.pwn(6329) : fatal error 107: too many error messages on one line
@EDIT

O SEU PRIMEIRO DEU ISSO, VOU TESTAR O SEGUNDO
Reply
#7

Eu acho ... nгo sei... que pode ser na configuraзгo do gamemode, ainda nгo saco muito nisso... mas deu esses erros no seu 2є post Willian :

pawn Код:
C:\Users\SHIELD\Desktop\Brasil StyleGames RPG\gamemodes\BSG.pwn(6323) : error 001: expected token: "-identifier-", but found ";"
C:\Users\SHIELD\Desktop\Brasil StyleGames RPG\gamemodes\BSG.pwn(6329) : error 017: undefined symbol "strtok"
C:\Users\SHIELD\Desktop\Brasil StyleGames RPG\gamemodes\BSG.pwn(6329 -- 6330) : error 033: array must be indexed (variable "tmp")
C:\Users\SHIELD\Desktop\Brasil StyleGames RPG\gamemodes\BSG.pwn(6330) : error 035: argument type mismatch (argument 2)
C:\Users\SHIELD\Desktop\Brasil StyleGames RPG\gamemodes\BSG.pwn(6330) : fatal error 107: too many error messages on one line
@EDIT

Willian, olha isso... nгo sei se tu viu esse gamemode jб... entгo olha sу :

pawn Код:
pAdmin,//Variavel do administrador, tudo serб assim - BrunoInfo[playerid]...
Reply
#8

Vк se o GM tem isso aqui
pawn Код:
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;
}
se nгo tiver tu coloca... (: e tenta
Reply
#9

Willian, nгo tem isso nгo ... de strtok, sу tem o comando agora que estou tentando adicionar; uma pergunta, em que parte coloco isso ?
Reply
#10

pode por no inicio do GM ou no final (:
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)