How me please!
#1

Who know how to fix this please?

Quote:

C:\Users\Administrator\Desktop\LS-RP\pawno\include\YSI\y_iterate.inc(909) : warning 202: number of arguments does not match definition
C:\Users\Administrator\Desktop\LS-RP\pawno\include\YSI\y_iterate.inc(922) : error 025: function heading differs from prototype
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Error.

Code erro :

Quote:

#define FILTERSCRIPT // i recommend integrating this into your gamemode

#include <a_samp>
#include <streamer>
#include <foreach>

#define NT_DISTANCE 25.0 // Nametag render distance

new Text3D:cNametag[MAX_PLAYERS];

public OnFilterScriptInit()
{
print("--- Custom nametags by nnahtann loaded.");
// OnPlayerUpdate causes lag and OnPlayer(Take/Give)Damage doesn't work with it
SetTimer("UpdateNametag", 500, true); // So we're using a timer, change the interval to what you want
return 1;
}
stock GetHealthDots(playerid)
{
new dots[64];
new Float:HP;

GetPlayerHealth(playerid, HP);

if(HP == 100)
dots = "__________";
else if(HP >= 90 && HP < 100)
dots = "_________{660000}_";
else if(HP >= 80 && HP < 90)
dots = "________{660000}__";
else if(HP >= 70 && HP < 80)
dots = "_______{660000}___";
else if(HP >= 60 && HP < 70)
dots = "______{660000}____";
else if(HP >= 50 && HP < 60)
dots = "_____{660000}_____";
else if(HP >= 40 && HP < 50)
dots = "____{660000}______";
else if(HP >= 30 && HP < 40)
dots = "___{660000}_______";
else if(HP >= 20 && HP < 30)
dots = "__{660000}________";
else if(HP >= 10 && HP < 20)
dots = "__{660000}_________";
else if(HP >= 0 && HP < 10)
dots = "{660000}__________";

return dots;
}
stock GetArmorDots(playerid)
{
new dots[64];
new Float:AR;

GetPlayerArmour(playerid, AR);

if(AR == 100)
dots = "__________";
else if(AR >= 90 && AR < 100)
dots = "_________{666666}_";
else if(AR >= 80 && AR < 90)
dots = "________{666666}__";
else if(AR >= 70 && AR < 80)
dots = "_______{666666}___";
else if(AR >= 60 && AR < 70)
dots = "••••••{666666}____";
else if(AR >= 50 && AR < 60)
dots = "_____{666666}_____";
else if(AR >= 40 && AR < 50)
dots = "____{666666}______";
else if(AR >= 30 && AR < 40)
dots = "___{666666}_______";
else if(AR >= 20 && AR < 30)
dots = "__{666666}________";
else if(AR >= 10 && AR < 20)
dots = "__{666666}________";
else if(AR >= 0 && AR < 10)
dots = "{666666}__________";

return dots;
}

public OnPlayerConnect(playerid)
{
cNametag[playerid] = CreateDynamic3DTextLabel("Loading nametag...", 0xFFFFFFFF, 0.0, 0.0, 0.1, NT_DISTANCE, .attachedplayer = playerid, .testlos = 1);
return 1;
}
public OnPlayerDisconnect(playerid)
{
if(IsValidDynamic3DTextLabel(cNametag[playerid]))
DestroyDynamic3DTextLabel(cNametag[playerid]);
return 1;
}
forward UpdateNametag();
public UpdateNametag()
{
foreach(new i : Player)
{
if(IsPlayerConnected(i))
{
new nametag[128], playername[MAX_PLAYER_NAME], Float:armour;
GetPlayerArmour(i, armour);
GetPlayerName(i, playername, sizeof(playername));
if(armour > 1.0)
{
format(nametag, sizeof(nametag), "{%06x}%s {FFFFFF}(%i)\n{FFFFFF}%s\n{FF0000}%s", GetPlayerColor(i) >>> 8, playername, i, GetArmorDots(i), GetHealthDots(i));
}
else
{
format(nametag, sizeof(nametag), "{%06x}%s {FFFFFF}(%i)\n{FF0000}%s", GetPlayerColor(i) >>> 8, playername, i, GetHealthDots(i));
}
UpdateDynamic3DTextLabelText(cNametag[i], 0xFFFFFFFF, nametag);
}
}
}

Reply
#2

Hi

You made wrong callback OnPlayerDisconnect
Change it to OnPlayerDisconnect(playerid, reason)
Reply
#3

Thanks bro
Reply
#4

I have already added the bug is 2 characters on the player's head, help me?
Image:https://uphinhnhanh.com/image/1dqChU
Reply
#5

Use ShowNameTags

PHP код:
ShowNameTags(0); 
Under OnGameModeInit
Reply
#6

Thanks
Reply
#7

I discovered another bug, two blood bar and armor, my name it does not need to be on top of the character now I want to edit those three, then what code should I use?
Reply
#8

show your code.
Reply
#9

I have already added the bug is 2 characters on the player's head, help me?
Image:https://uphinhnhanh.com/image/1dqChU

That's it

Quote:

#define FILTERSCRIPT // i recommend integrating this into your gamemode
#include <a_samp>
#include <streamer>
#include <foreach>

#define NT_DISTANCE 30 // Nametag render distance

new Text3D:cNametag[MAX_PLAYERS];
new playerName[MAX_PLAYER_NAME];

public OnGameModeInit()
{
SetNameTagDrawDistance(0.0);
ShowNameTags(false);
return 1;
}

public OnFilterScriptInit()
{
print("--- Custom nametags by nnahtann loaded.");
SetTimer("UpdateNametag", 500, true);
return 1;
}
stock GetHealthDots(playerid)
{
new dots[64];
new Float:HP;

GetPlayerHealth(playerid, HP);

if(HP == 100)
dots = "__________";
else if(HP >= 90 && HP < 100)
dots = "_________{660000}_";
else if(HP >= 80 && HP < 90)
dots = "________{660000}__";
else if(HP >= 70 && HP < 80)
dots = "_______{660000}___";
else if(HP >= 60 && HP < 70)
dots = "______{660000}____";
else if(HP >= 50 && HP < 60)
dots = "_____{660000}_____";
else if(HP >= 40 && HP < 50)
dots = "____{660000}______";
else if(HP >= 30 && HP < 40)
dots = "___{660000}_______";
else if(HP >= 20 && HP < 30)
dots = "__{660000}________";
else if(HP >= 10 && HP < 20)
dots = "__{660000}_________";
else if(HP >= 0 && HP < 10)
dots = "{660000}__________";

return dots;
}
stock GetArmorDots(playerid)
{
new dots[64];
new Float:AR;

GetPlayerArmour(playerid, AR);

if(AR == 100)
dots = "__________";
else if(AR >= 90 && AR < 100)
dots = "_________{666666}_";
else if(AR >= 80 && AR < 90)
dots = "________{666666}__";
else if(AR >= 70 && AR < 80)
dots = "_______{666666}___";
else if(AR >= 60 && AR < 70)
dots = "••••••{666666}____";
else if(AR >= 50 && AR < 60)
dots = "_____{666666}_____";
else if(AR >= 40 && AR < 50)
dots = "____{666666}______";
else if(AR >= 30 && AR < 40)
dots = "___{666666}_______";
else if(AR >= 20 && AR < 30)
dots = "__{666666}________";
else if(AR >= 10 && AR < 20)
dots = "__{666666}________";
else if(AR >= 0 && AR < 10)
dots = "{666666}__________";

return dots;
}

public OnPlayerConnect(playerid)
{
cNametag[playerid] = CreateDynamic3DTextLabel(playerName, 0xFFFFFFAA, 0.0, 0.0, 0.0, 20.0, playerid, INVALID_VEHICLE_ID, 0, -1, -1, -1, 20.0);
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
if(IsValidDynamic3DTextLabel(cNametag[playerid]))
DestroyDynamic3DTextLabel(cNametag[playerid]);
return 1;
}
forward UpdateNametag();
public UpdateNametag()
{
foreach(new i : Player)
{
if(IsPlayerConnected(i))
{
new nametag[128], playername[MAX_PLAYER_NAME], Float:armour;
GetPlayerArmour(i, armour);
GetPlayerName(i, playername, sizeof(playername));
if(armour > 1.0)
{
format(nametag, sizeof(nametag), "{%06x}%s {FFFFFF}(%i)\n{FFFFFF}%s\n{FF0000}%s", GetPlayerColor(i) >>> 8, playername, i, GetArmorDots(i), GetHealthDots(i));
}
else
{
format(nametag, sizeof(nametag), "{%06x}%s {FFFFFF}(%i)\n{FF0000}%s", GetPlayerColor(i) >>> 8, playername, i, GetHealthDots(i));
}
UpdateDynamic3DTextLabelText(cNametag[i], 0xFFFFFFFF, nametag);
}
}
}

Reply
#10

Add OnGameModeInit working in your gamemode.
Quote:

public OnGameModeInit()
{
ShowNameTags(0);
SetNameTagDrawDistance(0.0);
return 1;
}

or

Quote:

public OnFilterScriptInit()
{
print("--- Custom nametags by nnahtann loaded.");
SetNameTagDrawDistance(0.0);
ShowNameTags(false);
SetTimer("UpdateNametag", 500, true);
return 1;
}

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)