22.09.2016, 13:45
PHP код:
COMMAND:label(playerid, params[])
{
if (playerData[playerid][playerLoggedIn])
{
if(playerData[playerid][HasCustomLable])
{
new value[25];
if(sscanf(params, "s", value))
{
return SendClientMessage(playerid, COLOR_WHITE, "{B7B7B7}[SERVER] {FFFF00}Usage: \"lable TEXT [COST = 4000XP]\"");
}
else
{
if (playerData[playerid][playerXP] >= 4000)
{
if(strlen(value) < 16)
{
playerGiveXP(playerid, -4000);
playerData[playerid][CustomLabel] = Create3DTextLabel("%s", 0xFFDC2EFF, 30.0, 40.0, 50.0, 60.0, -1, 1, value);
Attach3DTextLabelToPlayer(playerData[playerid][CustomLabel], playerid, 0.0, 0.0, 0.4);
playerData[playerid][HasCustomLable] = true;
}
}
}
}
else if(playerData[playerid][HasCustomLable] == false)
{
Delete3DTextLabel(playerData[playerid][CustomLabel]);
SendClientMessage(playerid, -1, "Lable has been removed!");
}
}
return 1;
}
line 2603:
playerData[playerid][CustomLabel] = Create3DTextLabel("%s", 0xFFDC2EFF, 30.0, 40.0, 50.0, 60.0, -1, 1, value);