argument type mismatch (argument 2)
#1

pawn Код:
}
forward vitals(playerid);
public vitals(playerid)
{
    new string[5];
    new Float:pHealth, Float:pArmour;
    GetPlayerHealth(playerid,pHealth);
    GetPlayerArmour(playerid,pArmour);
    format(string, sizeof(string), "%.0f%", pHealth);
    TextDrawSetString(Health[playerid], string);
    format(string, sizeof(string), "%.0f%", pArmour);
    TextDrawSetString(Armour[playerid], string);
}
Error
Код:
C:\Users\N0FeaR\Desktop\PG\gamemodes\PG.PWN(2598) : warning 219: local variable "pHealth" shadows a variable at a preceding level
C:\Users\N0FeaR\Desktop\PG\gamemodes\PG.PWN(2599) : error 035: argument type mismatch (argument 2)
C:\Users\N0FeaR\Desktop\PG\gamemodes\PG.PWN(2598) : warning 203: symbol is never used: "pHealth"
This one
Код:
line 2598 new Float:pHealth, Float:pArmour;
line 2599 GetPlayerHealth(playerid,pHealth);
thanks in advance
Reply
#2

it means you have already use new pHealth; find for it in your script
Reply
#3

Код:
public vitals(playerid)
{
    new string[5];
    GetPlayerHealth(playerid,pHealth);
    GetPlayerArmour(playerid,pArmour);
    format(string, sizeof(string), "%.0f%", pHealth);
    TextDrawSetString(Health[playerid], string);
    format(string, sizeof(string), "%.0f%", pArmour);
    TextDrawSetString(Armour[playerid], string);
}
Reply
#4

Removed this
Код:
new Float:pHealth, Float:pArmour;
Still getting those errors...
Reply
#5

pHealth is already define before in the script.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)