28.01.2015, 23:47
Hello friends, I want to make an extra parameter to vip users, who would be able to change the color
pawn Code:
CMD:label(playerid, params[])
{
new
msg[128],
string[128]
;
if(GetPVarInt(playerid, "AdminOnDuty") == 1) return SendClientMessage(playerid, COLOR_ERROR, "[ERROR] You can't use this command on admin duty");
if(pInfo[playerid][VipLevel] == 0 && pInfo[playerid][EXP] < 1000) return SendClientMessage(playerid, COLOR_ERROR, "[ERROR] You need 1000 EXP or VIP to use this command");
if(sscanf(params, "s", msg) && pInfo[playerid][VipLevel] == 0 ) return SendClientMessage(playerid, COLOR_ORANGE, "Usage: /label [TEXT]");
format(string, sizeof(string), "%s", msg);
if(GetPVarInt(playerid, "PlayerLabel") == 0)
{
SetPVarInt(playerid, "PlayerLabel", 1);
PlayerLabel[playerid] = CreateDynamic3DTextLabel(string, COLOR_LABEL, 0.0, 0.0, 0.0+0.4, 15.0, playerid, INVALID_VEHICLE_ID, 0, -1, -1);
SendClientMessage(playerid, COLOR_SERVER, "[LABEL]"COL_WHITE" It made you the label successfully");
}
else
{
UpdateDynamic3DTextLabelText(PlayerLabel[playerid], COLOR_WHITE, string);
format(string, sizeof(string), "[LABEL]"COL_WHITE" You have changed your label to %s", msg);
SendClientMessage(playerid, COLOR_SERVER, string);
}
return 1;
}