Posts: 233
Threads: 82
Joined: Jan 2011
pawn Код:
new Text3D:ranklabel = Create3DTextLabel("Rank", 0x008080FF, 30.0, 40.0, 50.0, 40.0, 0);
Update3DTextLabelText(ranklabel, 0xFFFFFFFF, "%s", GetPlayerDMRank);
Attach3DTextLabelToPlayer(ranklabel, playerid, 0.0, 0.0, 0.7);
Obviously this doesn't work, but I hope you can see the logic behind it. I have a stock function which works out their DM rank name, and I'd like to attach this rank to their head - can anyone help? Thanks
Posts: 416
Threads: 47
Joined: May 2011
Reputation:
0
How can you even figure out the player's DM rank name without passing in the player ID to the function? GetPlayerDMRank simply won't work as you are not passing anything to the function.
That's unless GetPlayerDMRank is a local variable which you set to a string inside the function you're calling GetPlayerDMRank.
Posts: 233
Threads: 82
Joined: Jan 2011
Quote:
Originally Posted by Rufio
How can you even figure out the player's DM rank name without passing in the player ID to the function? GetPlayerDMRank simply won't work as you are not passing anything to the function.
That's unless GetPlayerDMRank is a local variable which you set to a string inside the function you're calling GetPlayerDMRank.
|
pawn Код:
GetPlayerDMRank(playerid)
{
new rankname[36];
if(PlayerInfo[playerid][pScore] >= 100 && PlayerInfo[playerid][pScore] < 249) { rankname = "Beginner"; }
else if(PlayerInfo[playerid][pScore] >= 250 && PlayerInfo[playerid][pScore] < 499) { rankname = "Advanced Beginner"; }
.. etc
That's the function
Posts: 233
Threads: 82
Joined: Jan 2011
Quote:
Originally Posted by Rufio
Change your code to this and it'll work;
pawn Код:
new Text3D:ranklabel = Create3DTextLabel("Rank", 0x008080FF, 30.0, 40.0, 50.0, 40.0, 0); Update3DTextLabelText(ranklabel, 0xFFFFFFFF, "%s", GetPlayerDMRank(playerid)); Attach3DTextLabelToPlayer(ranklabel, playerid, 0.0, 0.0, 0.7);
You are using a function without passing in the required parameter.
|
Of course, literally completely forgot about (playerid) lmao - will test it