[Ajuda] ta dando um BUG -
felipe_mr - 05.01.2012
Ola gente tudo bem, entгo vamos ao que me interessa (rs) eu to com um fs editado o criador e o tijoka e eu queria uma ajuda de vocкs porque quando eu entro no serve o indicador de fome ta la
depois eu saio e entro e nao ta mais
dou /gmx volta mas em outro lugar e de outro jeito e outra cor
alguem pode me ajudar com isso por favor
Код:
/*==============================================================================
FilterScript Feito por : Tijoka.
PS: Nгo retire os crйditos!!!!
/==============================================================================*/
#include <a_samp>
#include <dini>
new Text:Fome[MAX_PLAYERS];
new timer[MAX_PLAYERS];
new FomePlayer[MAX_PLAYERS];
forward TimeFome(playerid);
public OnFilterScriptInit()
{
for(new i=0; i<GetMaxPlayers(); i++)
{
Fome[i] = TextDrawCreate(17.000000,290.000000,"Fome:");
TextDrawAlignment(Fome[i],0);
TextDrawBackgroundColor(Fome[i],0x000000ff);
TextDrawFont(Fome[i],2);
TextDrawLetterSize(Fome[i],0.299999,1.400000);
TextDrawColor(Fome[i],0x00ff0066);
TextDrawSetOutline(Fome[i],1);
TextDrawSetProportional(Fome[i],1);
TextDrawSetShadow(Fome[i],1);
}
return 1;
}
public OnPlayerConnect(playerid)
{
SendClientMessage(playerid,0xFFF498,"Este servidor possui o sistema de fome by Tijoka!");
new arquivo[128];
format(arquivo,sizeof(arquivo),"Fome/%s.ini",Nome(playerid));
if(!dini_Exists(arquivo))
{
new str[128];
dini_Create(arquivo);
format(str,sizeof(str),"Arquivo de Fome criado com Sucesso!");
SendClientMessage(playerid,0xFFFF05,str);
}
FomePlayer[playerid] = dini_Int(arquivo,"Fome");
KillTimer(timer[playerid]);
if(FomePlayer[playerid]) AtualizarFome(playerid);
timer[playerid] = SetTimerEx("TimeFome",30000,true,"d",playerid);
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmdtext,"/comer",true) == 0)
{
if(!PlayerToPoint(4.0, playerid,1511.2161,-1670.3505,14.0469)) return SendClientMessage(playerid, 0xFF0000AA, "Vocк nгo estб no local para comer"); // Onde tem "X, Y, Z" vocк colocarб as coordenadas do local onde o jogador come.
new aa[200] = "1)Hamburguer - \t$: 20\n2)X Salada - \t$: 10\n3)Strogonoff - \t$: 30\n4)Batatas Fritas - \t$: 5\n5)Abacaxi - \t$: 15.";
ShowPlayerDialog(playerid, 23000, DIALOG_STYLE_LIST, "Cardбpio de Lanches", aa, "Selecionar","Sair");
return 1;
}
return 0;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 23000)
{
if(response == 1)
{
new arq[128];
new fome[128];
format(arq,sizeof(arq),"Fome/%s.ini",Nome(playerid));
if(listitem == 0)
{
if(GetPlayerMoney(playerid) < 20) return SendClientMessage(playerid,0xFF4565,"Vocк nгo possui $: 20!");
SendClientMessage(playerid,0xFFFF45,"Vocк comeu um hamburguer!");
FomePlayer[playerid] -= 10;
dini_IntSet(arq,"Fome",FomePlayer[playerid]);
GivePlayerMoney(playerid,-20);
format(fome,sizeof(fome),"Fome: %d%",FomePlayer[playerid]);
TextDrawSetString(Text:Fome[playerid],fome);
ApplyAnimation(playerid,"PED","VEND_Eat_P",4.1,0,1,1,1,5000);
}
else if(listitem == 1)
{
if(GetPlayerMoney(playerid) < 10) return SendClientMessage(playerid,0xFF4565,"Vocк nгo possui $: 10!");
SendClientMessage(playerid,0xFFFF45,"Vocк comeu um X-Salada!");
FomePlayer[playerid] -= 5;
GivePlayerMoney(playerid,-10);
dini_IntSet(arq,"Fome",FomePlayer[playerid]);
format(fome,sizeof(fome),"Fome: %d%",FomePlayer[playerid]);
TextDrawSetString(Text:Fome[playerid],fome);
ApplyAnimation(playerid,"PED","VEND_Eat_P",4.1,0,1,1,1,5000);
}
else if(listitem == 2)
{
if(GetPlayerMoney(playerid) < 30) return SendClientMessage(playerid,0xFF4565,"Vocк nгo possui $: 30!");
SendClientMessage(playerid,0xFFFF45,"Vocк comeu um Strogonoff!");
FomePlayer[playerid] -= 15;
dini_IntSet(arq,"Fome",FomePlayer[playerid]);
GivePlayerMoney(playerid,-30);
format(fome,sizeof(fome),"Fome: %d%",FomePlayer[playerid]);
TextDrawSetString(Text:Fome[playerid],fome);
ApplyAnimation(playerid,"PED","VEND_Eat_P",4.1,0,1,1,1,5000);
}
else if(listitem == 3)
{
if(GetPlayerMoney(playerid) < 5) return SendClientMessage(playerid,0xFF4565,"Vocк nгo possui $: 5!");
SendClientMessage(playerid,0xFFFF45,"Vocк comeu uma porзгo de batatas fritas!");
FomePlayer[playerid] -= 3;
GivePlayerMoney(playerid,-5);
dini_IntSet(arq,"Fome",FomePlayer[playerid]);
format(fome,sizeof(fome),"Fome: %d%",FomePlayer[playerid]);
TextDrawSetString(Text:Fome[playerid],fome);
ApplyAnimation(playerid,"PED","VEND_Eat_P",4.1,0,1,1,1,5000);
}
else if(listitem == 4)
{
if(GetPlayerMoney(playerid) < 15) return SendClientMessage(playerid,0xFF4565,"Vocк nгo possui $: 15!");
SendClientMessage(playerid,0xFFFF45,"Vocк comeu um abacaxi!");
FomePlayer[playerid] -= 13;
GivePlayerMoney(playerid,-15);
dini_IntSet(arq,"Fome",FomePlayer[playerid]);
format(fome,sizeof(fome),"Fome: %d%",FomePlayer[playerid]);
TextDrawSetString(Text:Fome[playerid],fome);
ApplyAnimation(playerid,"PED","VEND_Eat_P",4.1,0,1,1,1,5000);
}
}
}
return 1;
}
stock Nome(playerid)
{
new nome[MAX_PLAYER_NAME];
GetPlayerName(playerid, nome, sizeof(nome));
return nome;
}
public TimeFome(playerid)
{
FomePlayer[playerid]++;
if(FomePlayer[playerid] <= 0) FomePlayer[playerid] = 0;
AtualizarFome(playerid);
if(FomePlayer[playerid] == 80||FomePlayer[playerid] == 85||FomePlayer[playerid] == 90||FomePlayer[playerid] == 95||FomePlayer[playerid] == 99) SendClientMessage(playerid,0xFF0000,"Vocк estб ficando com fome, use /comer para se satisfazer!!");
if(FomePlayer[playerid] >= 100)
{
SendClientMessage(playerid,0xFF0000,"Vocк morreu de fome!!");
SetPlayerHealth(playerid,0.0);
FomePlayer[playerid] = 0;
}
}
stock AtualizarFome(playerid)
{
new arq[128];
new fome[128];
format(arq,sizeof(arq),"Fome/%s.ini",Nome(playerid));
TextDrawShowForPlayer(playerid,Fome[playerid]);
format(fome,sizeof(fome),"Fome: %d%",FomePlayer[playerid]);
dini_IntSet(arq,"Fome",FomePlayer[playerid]);
TextDrawSetString(Fome[playerid],fome);
}
forward PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z);
public PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z)
{
if(IsPlayerConnected(playerid))
{
new Float:oldposx, Float:oldposy, Float:oldposz;
new Float:tempposx, Float:tempposy, Float:tempposz;
GetPlayerPos(playerid, oldposx, oldposy, oldposz);
tempposx = (oldposx -x);
tempposy = (oldposy -y);
tempposz = (oldposz -z);
if(((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
{
return 1;
}
}
return 0;
}
Obs:O fs nгo tem nenhum erro e sim esse bug maldito
Re: [Ajuda] ta dando um BUG -
Lуs - 05.01.2012
Tente passar para o gm. Pois o gmx buga a maioria dos FS.
Re: [Ajuda] ta dando um BUG -
felipe_mr - 05.01.2012
mas e o texto que indica a fome quando eu re-logo ele sai
Re: [Ajuda] ta dando um BUG -
Lуs - 05.01.2012
Leia oque eu falei.
Re: [Ajuda] ta dando um BUG -
felipe_mr - 05.01.2012
da 4 error eu acho que tem que tirar algo tem ?
@EDIT
quando eu ponho no gm ta
Re: [Ajuda] ta dando um BUG -
Lуs - 05.01.2012
Erros? Quais?
Re: [Ajuda] ta dando um BUG -
felipe_mr - 05.01.2012
sao esses:
Код:
C:\Documents and Settings\familia mr\Desktop\teste\gamemodes\BAC.pwn(4345) : error 021: symbol already defined: "OnDialogResponse"
C:\Documents and Settings\familia mr\Desktop\teste\gamemodes\BAC.pwn(8363) : warning 217: loose indentation
C:\Documents and Settings\familia mr\Desktop\teste\gamemodes\BAC.pwn(8368) : warning 217: loose indentation
C:\Documents and Settings\familia mr\Desktop\teste\gamemodes\BAC.pwn(10969) : error 021: symbol already defined: "OnPlayerConnect"
C:\Documents and Settings\familia mr\Desktop\teste\gamemodes\BAC.pwn(20681) : error 021: symbol already defined: "OnPlayerCommandText"
C:\Documents and Settings\familia mr\Desktop\teste\gamemodes\BAC.pwn(22628) : warning 219: local variable "Nome" shadows a variable at a preceding level
C:\Documents and Settings\familia mr\Desktop\teste\gamemodes\BAC.pwn(37126) : warning 219: local variable "Nome" shadows a variable at a preceding level
C:\Documents and Settings\familia mr\Desktop\teste\gamemodes\BAC.pwn(48658) : warning 217: loose indentation
C:\Documents and Settings\familia mr\Desktop\teste\gamemodes\BAC.pwn(54089) : error 021: symbol already defined: "PlayerToPoint"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
4 Errors.
obs ja existia 3 warnings
Re: [Ajuda] ta dando um BUG -
felipe_mr - 05.01.2012
Alguйm pode me ajudar
![Huh?](images/smilies/confused.gif)
Respuesta: [Ajuda] ta dando um BUG -
Pedro Pawno - 05.01.2012
Code Comando GMX
pawn Код:
if (strcmp(cmdtext,"/gmx",true) == 0)
{
if (!IsPlayerAdmin(playerid))
return SendClientMessage(playerid,-1,"Vocк nгo й um Administrador RCON"); // Manda mensagem
SendClientMessageToAll(-1,"O Servidor esta sendo Reiniciado"); // Mensagem para todos jogadores , avisando que esta tendo GMX
SendRconCommand("Gmx"); // GMX
return true;
}
em public OnPlayerCommandText
Re: [Ajuda] ta dando um BUG -
humildadeforever - 05.01.2012
Esse erro estб dando porque as publics OnPlayerConnect, OnPlayerCommandText e OnDialogResponse jб foram definidas, ou seja, jб existem no GM, vocк deve copiar o FS pro GM sem copiar as publics que jб existem no GM, entгo deverб apenas copiar o conteъdo da public do FS e colar nas publics do GM.
Sem copiar a
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
pawn Код:
public OnPlayerConnect(playerid)
E nгo copia as chaves que abrem a public e as chaves que fecham a public.
Exemplo, no FS tб:
pawn Код:
public OnPlayerConnect(playerid)
{
SendClientMessage(playerid, -1,"oiiii amg");
return 1;
}
E no GM ta:
pawn Код:
public OnPlayerConnect(playerid)
{
SendClientMessage(playerid, -1,"oiiii td beem?");
SendClientMessage(playerid, -1, "a viidaa й tao bela");
SendClientMessage(playerid,-1,"tchaau bom joogo");
return 1;
}
Aн, pra copiar o conteъdo do FS voce deverб
copiar a linha
pawn Код:
SendClientMessage(playerid, -1,"oiiii amg");
que estб no FS e por no GM dentro da public.
Ficando:
pawn Код:
public OnPlayerConnect(playerid)
{
SendClientMessage(playerid, -1,"oiiii td beem?");
SendClientMessage(playerid, -1, "a viidaa й tao bela");
SendClientMessage(playerid,-1,"tchaau bom joogo");
SendClientMessage(playerid, -1,"oiiii amg");
return 1;
}
nao pode ficar as duas publics, espero que dк pra entender '-'