22.03.2015, 11:24
As you have heard previously from my topic "Rank System [Problem" i am creating a TDM server.
Now i have been receiving an issue of the labels for players, Apparently, the label only appears to ID 0 (results of the testing/do not rely on this though). The label disappears after the Spawn Protection (or it is never created)
Can someone help me up? Here is the code.
Any ideas?
Sorry if i have been positing threads with such simple problems, I just really need your help and i can assure you 100% that they are all scripted by me.
Now i have been receiving an issue of the labels for players, Apparently, the label only appears to ID 0 (results of the testing/do not rely on this though). The label disappears after the Spawn Protection (or it is never created)
Can someone help me up? Here is the code.
PHP код:
new Text3D:Label[MAX_PLAYERS];
// Stock function for my custom spawn
// Admin On Duty
if(aDuty[playerid] == 1)
{
Update3DTextLabelText(Label[playerid], COLOR_REALRED, "* DO NOT ATTACK, ADMIN ON DUTY **");
SetPlayerColor(playerid, COLOR_PINK);
aDuty[playerid] = 1;
SetPlayerArmour(playerid, 100000);
SetPlayerHealth(playerid, 100000);
}
// Label on Head
Update3DTextLabelText(Label[playerid], GetPlayerColor(playerid), GetRank(playerid));
// Rank Up function
Update3DTextLabelText(Label[playerid], GetPlayerColor(playerid), GetRank(playerid));
// Admin Duty
CMD:adminduty(playerid, params[])
{
new string[135], skinid;
if(pInfo[playerid][Admin] >= 1)
{
if(aDuty[playerid] == 0)
{
if(sscanf(params, "i", skinid)) return SendClientMessage(playerid, COLOR_PINK, "USAGE: /adminduty [skinid]");
if(skinid < 0 || skinid == 74 || skinid > 299) return SendClientMessage(playerid, COLOR_PINK, "Invalid SkinID.");
Update3DTextLabelText(Label[playerid], COLOR_REALRED, "* DO NOT ATTACK, ADMIN ON DUTY **");
SetPlayerColor(playerid, COLOR_PINK);
aDuty[playerid] = 1;
SetPlayerArmour(playerid, 100000);
SetPlayerHealth(playerid, 100000);
SetPlayerSkin(playerid, skinid);
format(string, sizeof(string), "%s %s is now on admin-duty (Color Pink Marker - Admin Duty Label)", GetAdminRank(playerid), nameEx(playerid));
SendClientMessageToAll(COLOR_PINK, string);
}
else if(aDuty[playerid] == 1)
{
Update3DTextLabelText(Label[playerid], -1, "SFW");
aDuty[playerid] = 0;
SpawnPlayer(playerid);
format(string, sizeof(string), "%s %s is now off admin-duty.", GetAdminRank(playerid), nameEx(playerid));
SendClientMessageToAll(COLOR_PINK, string);
}
}
else
{
SendClientMessage(playerid, COLOR_PINK, "You do not have the permission to access this command.");
}
return 1;
}
// On Player Connect
Delete3DTextLabel(Label[playerid]);
Label[playerid] = Create3DTextLabel("SWF", -1, 0.0, 0.0, 0.0, 7.0, 0);
Attach3DTextLabelToPlayer(Label[playerid], playerid, 0.0, 0.0, 0.5);
// On Player Disconnect
Delete3DTextLabel(Label[playerid]);
// Spawn Protection OnPlayerSpawn
Update3DTextLabelText(Label[playerid], COLOR_LIME, "* Spawn Protection *");
Sorry if i have been positing threads with such simple problems, I just really need your help and i can assure you 100% that they are all scripted by me.