SA-MP Forums Archive
Help? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Help? (/showthread.php?tid=599614)



Help? - Hellman92 - 28.01.2016

Cant see what i did wrong here someone can help me out? thanks in advance!

Код:
./includes/callbacks.pwn(4132) : warning 219: local variable "pHealth" shadows a variable at a preceding level
./includes/callbacks.pwn(4133) : error 035: argument type mismatch (argument 2)
./includes/callbacks.pwn(4132) : warning 203: symbol is never used: "pHealth"
PHP код:
}
forward vitals(playerid);
public 
vitals(playerid)
{
    new 
string[25];
    new 
Float:pHealthFloat:pArmour;
    
GetPlayerHealth(playerid,pHealth);
    
GetPlayerArmour(playerid,pArmour);
    
format(stringsizeof(string), "%.0f%"pHealth);
    
TextDrawSetString(Health[playerid], string);
    
format(stringsizeof(string), "%.0f%"pArmour);
    
TextDrawSetString(Armour[playerid], string);




Re: Help? - jlalt - 28.01.2016

.
Код:
/includes/callbacks.pwn(4132) : warning 219: local variable "pHealth" shadows a variable at a preceding level
that mean you already have new FloatHealth some where so instead it try to add FloatHealth1 >>

PHP код:
forward vitals(playerid); 
public 
vitals(playerid

    new 
string[25]; 
    new 
Float:pHealth1Float:pArmour
    
GetPlayerHealth(playerid,pHealth1); 
    
GetPlayerArmour(playerid,pArmour); 
    
format(stringsizeof(string), "%.0f%"pHealth1); 
    
TextDrawSetString(Health[playerid], string); 
    
format(stringsizeof(string), "%.0f%"pArmour); 
    
TextDrawSetString(Armour[playerid], string); 




Re: Help? - Hellman92 - 28.01.2016

Quote:
Originally Posted by jlalt
Посмотреть сообщение
.
Код:
/includes/callbacks.pwn(4132) : warning 219: local variable "pHealth" shadows a variable at a preceding level
that mean you already have new FloatHealth some where so instead it try to add FloatHealth1 >>

PHP код:
forward vitals(playerid); 
public 
vitals(playerid

    new 
string[25]; 
    new 
Float:pHealth1Float:pArmour
    
GetPlayerHealth(playerid,pHealth1); 
    
GetPlayerArmour(playerid,pArmour); 
    
format(stringsizeof(string), "%.0f%"pHealth1); 
    
TextDrawSetString(Health[playerid], string); 
    
format(stringsizeof(string), "%.0f%"pArmour); 
    
TextDrawSetString(Armour[playerid], string); 

I cant find the other one floathealth lol xD


Re: Help? - Weponz - 28.01.2016

Is that code in /includes/callbacks.pwn? Otherwise pHealth is used in the include stated.


Re: Help? - Hellman92 - 28.01.2016

Quote:
Originally Posted by Weponz
Посмотреть сообщение
Is that code in /includes/callbacks.pwn? Otherwise pHealth is used in the include stated.
I found out what was the problem.