[Ajuda] Sistema de detetive -
Alien_Halls - 06.01.2012
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 ?
Re: [Ajuda] Sistema de detetive -
Hardware - 06.01.2012
Coloque isso, depois diga o que acontece.
pawn Код:
new cmd[128];
new PlayerOnMission[MAX_PLAYERS];
Respuesta: [Ajuda] Sistema de detetive -
Alien_Halls - 06.01.2012
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
Re: [Ajuda] Sistema de detetive -
Hardware - 06.01.2012
pawn Код:
new tmp[128];
new giveplayerid,giveplayer;
Re: [Ajuda] Sistema de detetive -
AdrianO_ - 06.01.2012
lol retire o AlieN do seu nick e deixe somente halls,ok?
Respuesta: Re: [Ajuda] Sistema de detetive -
Alien_Halls - 06.01.2012
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!
Re: [Ajuda] Sistema de detetive -
felipe_mr - 06.01.2012
tenta assim:
PHP код:
if(strcmp(cmd, "/procurar", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pEmprego] != 1)
{
MSGPLAYER(playerid, COLOR_GREY, " Vocк nгo й Detetive !");
return 1;
}
if(UsedFind[playerid] != 0 && PlayerInfo[playerid][pDetSkill] < 401)
{
MSGPLAYER(playerid, COLOR_GREY, " Vocк sу pode procurar novamente, daqui a 2 Minutos !");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
MSGPLAYER(playerid, COLOR_GRAD2, "USE: /procurar [id]");
return 1;
}
giveplayerid = ReturnUser(tmp);
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
if(giveplayerid == playerid) { MSGPLAYER(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 = 12; }
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
new Float:X,Float:Y,Float:Z;
GetPlayerPos(giveplayerid, X,Y,Z);
SetPlayerCheckpoint(playerid, X,Y,Z, 6);
FindTime[playerid] = 1;
FindTimePoints[playerid] = points;
PlayerInfo[playerid][pDetSkill] ++;
UsedFind[playerid] = 1;
if(PlayerInfo[playerid][pDetSkill] == 50)
{ MSGPLAYER(playerid, COLOR_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(playerid, COLOR_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(playerid, COLOR_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(playerid, COLOR_YELLOW, "* Seu nнvel de detetive agora й 5, Vocк pode procurar mais rбpido e encontrar mais rбpido."); }
}
}
else
{
MSGPLAYER(playerid, COLOR_GREY, " Esse nгo й um jogador ativo !");
}
}
return 1;
}
Respuesta: [Ajuda] Sistema de detetive -
Alien_Halls - 06.01.2012
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
Respuesta: [Ajuda] Sistema de detetive -
Alien_Halls - 07.01.2012
Entгo alguem sabe resolver ? ou vгo deixar mais um topico sem soluзгo e nem resposta boiar aq no forum ?
Re: [Ajuda] Sistema de detetive -
Ricop522 - 07.01.2012
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.