[Ajuda] diz q ja ta definido mais num ta!!!
#1

galera vejam essa public:

pawn Код:
public Fome(playerid)
{
//============================================================================//
    SetPVarInt(playerid,"Fome",GetPVarInt(playerid,"Fome")+5);
    SetProgressBarValue(FomeA, GetPVarInt(playerid,"Fome"));
    UpdateProgressBar(FomeA,playerid);
    if(GetPVarInt(playerid,"Fome") >= 95)
    {
        new Float:Vida;
        GetPlayerHealth(playerid,Vida),SetPlayerHealth(playerid,Vida-90.0);
        SendClientMessage(playerid,-1,"{AA3333}Vai Comer algo Ou Morrera.");
    }
//============================================================================//
    return 1;
}
ta dando esse error:
"error 021: symbol already defined: "Fome""
mas nгo hб outra public fome no sv....
Reply
#2

Tenta !

PHP код:
public Fome(playerid)
{
//============================================================================//
    
new Fome;
    
SetPVarInt(playerid,"Fome",GetPVarInt(playerid,"Fome")+5);
    
SetProgressBarValue(FomeAGetPVarInt(playerid,"Fome"));
    
UpdateProgressBar(FomeA,playerid);
    if(
GetPVarInt(playerid,"Fome") >= 95)
    {
        new 
Float:Vida;
        
GetPlayerHealth(playerid,Vida),SetPlayerHealth(playerid,Vida-90.0);
        
SendClientMessage(playerid,-1,"{AA3333}Vai Comer algo Ou Morrera.");
    }
//============================================================================//
    
return 1;

Reply
#3

Quote:
Originally Posted by SonicFreeStyle
Посмотреть сообщение
galera vejam essa public:

pawn Код:
public Fome(playerid)
{
//============================================================================//
    SetPVarInt(playerid,"Fome",GetPVarInt(playerid,"Fome")+5);
    SetProgressBarValue(FomeA, GetPVarInt(playerid,"Fome"));
    UpdateProgressBar(FomeA,playerid);
    if(GetPVarInt(playerid,"Fome") >= 95)
    {
        new Float:Vida;
        GetPlayerHealth(playerid,Vida),SetPlayerHealth(playerid,Vida-90.0);
        SendClientMessage(playerid,-1,"{AA3333}Vai Comer algo Ou Morrera.");
    }
//============================================================================//
    return 1;
}
ta dando esse error:
"error 021: symbol already defined: "Fome""
mas nгo hб outra public fome no sv....
Esta ocorrendo erro, devido "Fome" jб estar sendo usada por uma callback, e vocк esta definindo ela para uma Variavel ao mesmo tempo. Tente redefinir alguma das duas.
Reply
#4

agora deu 3 erros kkkkk

pawn Код:
error 021: symbol already defined: "Fome"
warning 219: local variable "Fome" shadows a variable at a preceding level
 warning 203: symbol is never used: "Fome"
na verdade todos os erros sгo esses:
pawn Код:
(8221) : error 021: symbol already defined: "Fome"
(8223) : warning 219: local variable "Fome" shadows a variable at a preceding level
(8223) : warning 203: symbol is never used: "Fome"
(12510) : error 028: invalid subscript (not an array or too many subscripts): "Fome"
(12510) : warning 215: expression has no effect
(12510) : error 001: expected token: ";", but found "]"
(12510) : error 029: invalid expression, assumed zero
(12510) : fatal error 107: too many error messages on one line
a linha 12510 й isso:

pawn Код:
Fome[i] = TextDrawCreate(500.000000, 250.000000,"_"); // Linha 12510
        TextDrawUseBox(Fome[i],0);
        TextDrawBoxColor(Fome[i],0x00000065);
        TextDrawTextSize(Fome[i],633.000000, -19.000000);
        TextDrawAlignment(Fome[i],0);
        TextDrawBackgroundColor(Fome[i],0x000000FF);
        TextDrawFont(Fome[i],1);
        TextDrawLetterSize(Fome[i],0.270000, 1.000000);
        TextDrawColor(Fome[i],0xFFFFFFFF);
        TextDrawSetOutline(Fome[i],1);
        TextDrawSetProportional(Fome[i],1);
        TextDrawSetShadow(Fome[i],1);
Reply
#5

Tente assim

pawn Код:
//******************************************************************************
new Bar:ComFome;
new Text:TextoFome[MAX_PLAYERS];
//******************************************************************************
forward DarFome(playerid);
//******************************************************************************
public OnGameModeInit(){
    TextoFome[i] = TextDrawCreate(500.000000, 250.000000,"_");
    TextDrawUseBox(TextoFome[i],0);
    TextDrawBoxColor(TextoFome[i],0x00000065);
    TextDrawTextSize(TextoFome[i],633.000000, -19.000000);
    TextDrawAlignment(TextoFome[i],0);
    TextDrawBackgroundColor(TextoFome[i],0x000000FF);
    TextDrawFont(TextoFome[i],1);
    TextDrawLetterSize(TextoFome[i],0.270000, 1.000000);
    TextDrawColor(TextoFome[i],0xFFFFFFFF);
    TextDrawSetOutline(TextoFome[i],1);
    TextDrawSetProportional(TextoFome[i],1);
    TextDrawSetShadow(TextoFome[i],1);
    return 1;
}
//******************************************************************************
public DarFome(playerid){
    SetPVarInt(playerid,"CFome",GetPVarInt(playerid,"CFome")+5);
    SetProgressBarValue(ComFome, GetPVarInt(playerid,"CFome"));
    UpdateProgressBar(ComFome,playerid);
    if(GetPVarInt(playerid,"CFome") >= 95){
        new Float:Vida;
        GetPlayerHealth(playerid,Vida),SetPlayerHealth(playerid,Vida-90.0);
        SendClientMessage(playerid,-1,"{AA3333}Vai Comer algo Ou Morrera.");
    }
    return 1;
}
Reply
#6

o erro do define sumiu mais o erro da linha do textdraw continua:

pawn Код:
TextoFome[i] = TextDrawCreate(500.000000, 250.000000,"_"); //erro nesta linha!
        TextDrawUseBox(TextoFome[i],0);
        TextDrawBoxColor(TextoFome[i],0x00000065);
        TextDrawTextSize(TextoFome[i],633.000000, -19.000000);
        TextDrawAlignment(TextoFome[i],0);
        TextDrawBackgroundColor(TextoFome[i],0x000000FF);
        TextDrawFont(TextoFome[i],1);
        TextDrawLetterSize(TextoFome[i],0.270000, 1.000000);
        TextDrawColor(TextoFome[i],0xFFFFFFFF);
        TextDrawSetOutline(TextoFome[i],1);
        TextDrawSetProportional(TextoFome[i],1);
        TextDrawSetShadow(TextoFome[i],1);
Reply
#7

erro meu coloque esse cуdigo ai entre uma

pawn Код:
for(new i = 0; i <MAX_PLAYERS; i++){
//Aqui dentro
}
Reply
#8

ele ja esta
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)