[Ajuda] Sistema de detetive
#1

Sistema de detetive que procura seguindo dando alguns erros:

Olha o cmd:

pawn Код:
if(strcmp(cmd, "/procurar", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(PlayerInfo[playerid][pEmprego] != 1)
            {
                SendClientMessage(playerid, COLOR_GREY, "   Vocк nгo й Detetive !");
                return 1;
            }
            if(PlayerOnMission[playerid] > 0)
            {
                SendClientMessage(playerid, COLOR_GREY, "   Vocк estб em uma missгo, nгo pode usar este comando !");
                return 1;
            }
            if(UsedFind[playerid] != 0 && PlayerInfo[playerid][pDetSkill] < 401)
            {
                SendClientMessage(playerid, COLOR_GREY, "   Vocк sу pode procurar novamente, daqui a 2 Minutos !");
                return 1;
            }
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "USE: /procurar [ id ]");
                return 1;
            }
            giveplayerid = ReturnUser(tmp);
            if(IsPlayerConnected(giveplayerid))
            {
                if(giveplayerid != INVALID_PLAYER_ID)
                {
                    if(giveplayerid == playerid) { SendClientMessage(playerid, COLOR_GREY, "Vocк nгo pode se procurar!"); return 1; }
                    new points;
                    new level = PlayerInfo[playerid][pDetSkill];
                    if(level >= 0 && level <= 50)
                    { points = 4; }
                    else if(level >= 51 && level <= 100)
                    { points = 6; }
                    else if(level >= 101 && level <= 200)
                    { points = 8; }
                    else if(level >= 201 && level <= 400)
                    { points = 10; }
                    else if(level >= 401)
                    { points = 60; }
                    GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
                    KillTimer(GetPVarInt(playerid,"TimerProcura"));
                    DisablePlayerCheckpoint(playerid);
                    DeletePVar(playerid,"TimerProcura");
                    new TimerProcura;
                    TimerProcura = SetTimerEx("GivePlayerIDCheckpoint", 1000, true, "di", playerid, giveplayerid);
                    SetPVarInt(playerid,"TimerProcura",TimerProcura);
                    FindTime[playerid] = 1;
                    FindTimePoints[playerid] = points;
                    PlayerInfo[playerid][pDetSkill] ++;
                    UsedFind[playerid] = 1;
                    if(PlayerInfo[playerid][pDetSkill] == 50)
                    { SendClientMessage(playerid, COLOR_YELLOW, "* Seu nivel de detetive agora й 2, Vocк pode procurar mais rapido e encontrar mais rapido."); }
                    else if(PlayerInfo[playerid][pDetSkill] == 100)
                    { SendClientMessage(playerid, COLOR_YELLOW, "* Seu nivel de detetive agora й 3, Vocк pode procurar mais rapido e encontrar mais rapido."); }
                    else if(PlayerInfo[playerid][pDetSkill] == 200)
                    { SendClientMessage(playerid, COLOR_YELLOW, "* Seu nivel de detetive agora й 4, Vocк pode procurar mais rapido e encontrar mais rapido."); }
                    else if(PlayerInfo[playerid][pDetSkill] == 400)
                    { SendClientMessage(playerid, COLOR_YELLOW, "* Seu nivel de detetive agora й 5, Vocк pode procurar mais rapido e encontrar mais rapido."); }
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_GREY, "   Invalido NICK/ID !");
            }
        }
        return 1;
    }
Olha os erros:

pawn Код:
C:\Documents and Settings\Christian temp\Desktop\Gamemods\BHL\gamemodes\BHL.pwn(3444) : warning: 217: loose indentation
C:\Documents and Settings\Christian temp\Desktop\Gamemods\BHL\gamemodes\BHL.pwn(3444) : error: 017: undefined symbol "cmd"
C:\Documents and Settings\Christian temp\Desktop\Gamemods\BHL\gamemodes\BHL.pwn(3444) : error: 017: undefined symbol "PlayerOnMission"
C:\Documents and Settings\Christian temp\Desktop\Gamemods\BHL\gamemodes\BHL.pwn(3444) : warning: 215: expression has no effect
C:\Documents and Settings\Christian temp\Desktop\Gamemods\BHL\gamemodes\BHL.pwn(3444) : error: 001: expected token: ";", but found "]"
C:\Documents and Settings\Christian temp\Desktop\Gamemods\BHL\gamemodes\BHL.pwn(3444) : error: 029: invalid expression, assumed zero
C:\Documents and Settings\Christian temp\Desktop\Gamemods\BHL\gamemodes\BHL.pwn(3444) : error fatal: 107: too many error messages on one line
Alguem sabe resolver ?
Reply
#2

Coloque isso, depois diga o que acontece.
pawn Код:
new cmd[128];
new PlayerOnMission[MAX_PLAYERS];
Reply
#3

coloquei no topo do gm e deu esses erros olha:

pawn Код:
C:\Documents and Settings\Christian temp\Desktop\Gamemods\BHL\gamemodes\Gm a ajeitar\BHL.pwn(3457) : warning: 217: loose indentation
C:\Documents and Settings\Christian temp\Desktop\Gamemods\BHL\gamemodes\Gm a ajeitar\BHL.pwn(3457) : error: 017: undefined symbol "tmp"
C:\Documents and Settings\Christian temp\Desktop\Gamemods\BHL\gamemodes\Gm a ajeitar\BHL.pwn(3457) : error: 017: undefined symbol "cmdtext"
C:\Documents and Settings\Christian temp\Desktop\Gamemods\BHL\gamemodes\Gm a ajeitar\BHL.pwn(3457) : error: 017: undefined symbol "tmp"
C:\Documents and Settings\Christian temp\Desktop\Gamemods\BHL\gamemodes\Gm a ajeitar\BHL.pwn(3457) : error: 017: undefined symbol "giveplayerid"
C:\Documents and Settings\Christian temp\Desktop\Gamemods\BHL\gamemodes\Gm a ajeitar\BHL.pwn(3457) : error: 017: undefined symbol "tmp"
C:\Documents and Settings\Christian temp\Desktop\Gamemods\BHL\gamemodes\Gm a ajeitar\BHL.pwn(3457) : error: 017: undefined symbol "giveplayerid"
C:\Documents and Settings\Christian temp\Desktop\Gamemods\BHL\gamemodes\Gm a ajeitar\BHL.pwn(3457) : error: 017: undefined symbol "giveplayerid"
C:\Documents and Settings\Christian temp\Desktop\Gamemods\BHL\gamemodes\Gm a ajeitar\BHL.pwn(3457) : error: 017: undefined symbol "giveplayerid"
C:\Documents and Settings\Christian temp\Desktop\Gamemods\BHL\gamemodes\Gm a ajeitar\BHL.pwn(3457) : error: 017: undefined symbol "giveplayerid"
C:\Documents and Settings\Christian temp\Desktop\Gamemods\BHL\gamemodes\Gm a ajeitar\BHL.pwn(3457) : error: 017: undefined symbol "giveplayer"
C:\Documents and Settings\Christian temp\Desktop\Gamemods\BHL\gamemodes\Gm a ajeitar\BHL.pwn(3457) : error: 029: invalid expression, assumed zero
C:\Documents and Settings\Christian temp\Desktop\Gamemods\BHL\gamemodes\Gm a ajeitar\BHL.pwn(3457) : error fatal: 107: too many error messages on one line
Reply
#4

pawn Код:
new tmp[128];
new giveplayerid,giveplayer;
Reply
#5

lol retire o AlieN do seu nick e deixe somente halls,ok?
Reply
#6

Quote:
Originally Posted by AdrianO_
Посмотреть сообщение
lol retire o AlieN do seu nick e deixe somente halls,ok?
primeiro!
num й AlieN!
й Alien!

segundo: sempre joguei samp com esse nick! e num й pq tem um cara chamado AlieN aqui q eu eu vo muda meu nick!

terceiro: Entro sу pra falar isso ? ajudar q й bom nada nй ?
Perdeu seu tempo!
Reply
#7

tenta assim:

PHP код:
if(strcmp(cmd"/procurar"true) == 0)
    {
        if(
IsPlayerConnected(playerid))
        {
            if(
PlayerInfo[playerid][pEmprego] != 1)
            {
                
MSGPLAYER(playeridCOLOR_GREY"   Vocк nгo й Detetive !");
                return 
1;
            }
            if(
UsedFind[playerid] != && PlayerInfo[playerid][pDetSkill] < 401)
            {
                
MSGPLAYER(playeridCOLOR_GREY"   Vocк sу pode procurar novamente, daqui a 2 Minutos !");
                return 
1;
            }
            
tmp strtok(cmdtextidx);
            if(!
strlen(tmp))
            {
                
MSGPLAYER(playeridCOLOR_GRAD2"USE: /procurar [id]");
                return 
1;
            }
            
giveplayerid ReturnUser(tmp);
            if(
IsPlayerConnected(giveplayerid))
            {
                if(
giveplayerid != INVALID_PLAYER_ID)
                {
                    if(
giveplayerid == playerid) { MSGPLAYER(playeridCOLOR_GREY"Vocк nгo pode se procurar!"); return 1; }
                    new 
points;
                    new 
level PlayerInfo[playerid][pDetSkill];
                    if(
level >= && level <= 50)
                    { 
points 4; }
                    else if(
level >= 51 && level <= 100)
                    { 
points 6; }
                    else if(
level >= 101 && level <= 200)
                    { 
points 8; }
                    else if(
level >= 201 && level <= 400)
                    { 
points 10; }
                    else if(
level >= 401)
                    { 
points 12; }
                    
GetPlayerName(giveplayeridgiveplayersizeof(giveplayer));
                    new 
Float:X,Float:Y,Float:Z;
                    
GetPlayerPos(giveplayeridX,Y,Z);
                    
SetPlayerCheckpoint(playeridX,Y,Z6);
                    
FindTime[playerid] = 1;
                    
FindTimePoints[playerid] = points;
                    
PlayerInfo[playerid][pDetSkill] ++;
                    
UsedFind[playerid] = 1;
                    if(
PlayerInfo[playerid][pDetSkill] == 50)
                    { 
MSGPLAYER(playeridCOLOR_YELLOW"* Seu nнvel de detetive agora й 2, Vocк pode procurar mais rбpido e encontrar mais rбpido."); }
                    else if(
PlayerInfo[playerid][pDetSkill] == 100)
                    { 
MSGPLAYER(playeridCOLOR_YELLOW"* Seu nнvel de detetive agora й 3, Vocк pode procurar mais rбpido e encontrar mais rбpido."); }
                    else if(
PlayerInfo[playerid][pDetSkill] == 200)
                    { 
MSGPLAYER(playeridCOLOR_YELLOW"* Seu nнvel de detetive agora й 4, Vocк pode procurar mais rбpido e encontrar mais rбpido."); }
                    else if(
PlayerInfo[playerid][pDetSkill] == 400)
                    { 
MSGPLAYER(playeridCOLOR_YELLOW"* Seu nнvel de detetive agora й 5, Vocк pode procurar mais rбpido e encontrar mais rбpido."); }
                }
            }
            else
            {
                
MSGPLAYER(playeridCOLOR_GREY"   Esse nгo й um jogador ativo !");
            }
        }
        return 
1;
    } 
Reply
#8

deu esses erros olha

pawn Код:
C:\Documents and Settings\Christian temp\Desktop\Gamemods\BHL\gamemodes\Gm a ajeitar\BHL.pwn(3462) : warning: 217: loose indentation
C:\Documents and Settings\Christian temp\Desktop\Gamemods\BHL\gamemodes\Gm a ajeitar\BHL.pwn(3462) : error: 017: undefined symbol "MSGPLAYER"
C:\Documents and Settings\Christian temp\Desktop\Gamemods\BHL\gamemodes\Gm a ajeitar\BHL.pwn(3462) : error: 017: undefined symbol "MSGPLAYER"
C:\Documents and Settings\Christian temp\Desktop\Gamemods\BHL\gamemodes\Gm a ajeitar\BHL.pwn(3462) : error: 017: undefined symbol "tmp"
C:\Documents and Settings\Christian temp\Desktop\Gamemods\BHL\gamemodes\Gm a ajeitar\BHL.pwn(3462) : error: 017: undefined symbol "cmdtext"
C:\Documents and Settings\Christian temp\Desktop\Gamemods\BHL\gamemodes\Gm a ajeitar\BHL.pwn(3462) : error: 017: undefined symbol "tmp"
C:\Documents and Settings\Christian temp\Desktop\Gamemods\BHL\gamemodes\Gm a ajeitar\BHL.pwn(3462) : error: 017: undefined symbol "MSGPLAYER"
C:\Documents and Settings\Christian temp\Desktop\Gamemods\BHL\gamemodes\Gm a ajeitar\BHL.pwn(3462) : error: 017: undefined symbol "giveplayerid"
C:\Documents and Settings\Christian temp\Desktop\Gamemods\BHL\gamemodes\Gm a ajeitar\BHL.pwn(3462) : error: 017: undefined symbol "tmp"
C:\Documents and Settings\Christian temp\Desktop\Gamemods\BHL\gamemodes\Gm a ajeitar\BHL.pwn(3462) : error: 017: undefined symbol "giveplayerid"
C:\Documents and Settings\Christian temp\Desktop\Gamemods\BHL\gamemodes\Gm a ajeitar\BHL.pwn(3462) : error: 017: undefined symbol "giveplayerid"
C:\Documents and Settings\Christian temp\Desktop\Gamemods\BHL\gamemodes\Gm a ajeitar\BHL.pwn(3462) : error: 017: undefined symbol "giveplayerid"
C:\Documents and Settings\Christian temp\Desktop\Gamemods\BHL\gamemodes\Gm a ajeitar\BHL.pwn(3462) : error: 017: undefined symbol "MSGPLAYER"
C:\Documents and Settings\Christian temp\Desktop\Gamemods\BHL\gamemodes\Gm a ajeitar\BHL.pwn(3462) : error: 017: undefined symbol "giveplayerid"
C:\Documents and Settings\Christian temp\Desktop\Gamemods\BHL\gamemodes\Gm a ajeitar\BHL.pwn(3462) : error: 017: undefined symbol "giveplayer"
C:\Documents and Settings\Christian temp\Desktop\Gamemods\BHL\gamemodes\Gm a ajeitar\BHL.pwn(3462) : error: 029: invalid expression, assumed zero
C:\Documents and Settings\Christian temp\Desktop\Gamemods\BHL\gamemodes\Gm a ajeitar\BHL.pwn(3462) : error fatal: 107: too many error messages on one line
Reply
#9

Entгo alguem sabe resolver ? ou vгo deixar mais um topico sem soluзгo e nem resposta boiar aq no forum ?
Reply
#10

Vocк tб pegando um comando de outro gamemode e colocando no seu.. уbvio que vai dar erros --'
Vocк nгo tem new cmd[128]; na Public OnPlayerCommandText
Vocк nгo tem a public returnuser(.)

Vocк tem que colocar o comando na public OnPlayerCommandText, em baixo!

pawn Код:
if(!strcmp(cmdtext, "/procurar", true, 9))
    {
        if(!IsPlayerConnected(playerid))  return 1;  
        if(PlayerInfo[playerid][pEmprego] != 1) return SendClientMessage(playerid, COLOR_GREY, "   Vocк nгo й Detetive !");
        if(UsedFind[playerid] != 0 && PlayerInfo[playerid][pDetSkill] < 401) return SendClientMessage(playerid, COLOR_GREY, "   Vocк sу pode procurar novamente, daqui a 2 Minutos !");
        if(!strlen(cmdtext[9]))  return SendClientMessage(playerid, COLOR_GRAD2, "USE: /procurar [id]");
        new giveplayerid = cmdtext[10];
        if(!IsPlayerConnected(giveplayerid)|| giveplayerid == INVALID_PLAYER_ID || giveplayerid == playerid) return SendClientMessage(playerid, -1, "Jogador offline");
             
        GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
        new Float:Pos[3];
        GetPlayerPos(giveplayerid, Pos[0],Pos[1],Pos[2]);
        SetPlayerCheckpoint(playerid, Pos[0],Pos[1],Pos[2], 6);
        FindTime[playerid] = 1;
        FindTimePoints[playerid] = points;
        PlayerInfo[playerid][pDetSkill] ++;
        UsedFind[playerid] = 1;
        if(PlayerInfo[playerid][pDetSkill] == 50) SendClientMessage(playerid, COLOR_YELLOW, "* Seu nнvel de detetive agora й 2, Vocк pode procurar mais rбpido e encontrar mais rбpido."); }
        if(PlayerInfo[playerid][pDetSkill] == 100) SendClientMessage(playerid, COLOR_YELLOW, "* Seu nнvel de detetive agora й 3, Vocк pode procurar mais rбpido e encontrar mais rбpido."); }
        if(PlayerInfo[playerid][pDetSkill] == 200) SendClientMessage(playerid, COLOR_YELLOW, "* Seu nнvel de detetive agora й 4, Vocк pode procurar mais rбpido e encontrar mais rбpido."); }
        if(PlayerInfo[playerid][pDetSkill] == 400) SendClientMessage(playerid, COLOR_YELLOW, "* Seu nнvel de detetive agora й 5, Vocк pode procurar mais rбpido e encontrar mais rбpido."); }
        return 1;
    }
Se nгo conseguir, sugiro ler mais sobre Pawn.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)