CMD:ame(playerid, params[])
{
new activewep = GetPVarInt(playerid, "activesling");
new message[100], string[128];
if(sscanf(params, "s[100]", message))
{
SendClientMessageEx(playerid, COLOR_GRAD2, "USAGE: /ame [action]");
SendClientMessageEx(playerid, COLOR_GRAD2, "NOTE: Set the action to OFF to remove the label.");
return 1;
}
if(activewep > 0)
{
SendClientMessageEx(playerid, COLOR_GRAD2, " You have a weapon slung around your back, you can't use /ame.");
return 1;
}
if(strcmp(message, "off", true) == 0)
{
SendClientMessageEx(playerid, COLOR_GRAD2, " You have removed the description label.");
DestroyDynamic3DTextLabel(PlayerInfo[playerid][aMeID]);
PlayerInfo[playerid][aMeStatus] =0;
return 1;
}
if(strlen(message) > 100) return SendClientMessageEx(playerid, COLOR_GRAD2, " The action is too long, please reduce the length.");
if(strlen(message) < 3) return SendClientMessageEx(playerid, COLOR_GRAD2, " The action is too short, please increase the length.");
if(PlayerInfo[playerid][aMeStatus] == 0)
{
PlayerInfo[playerid][aMeStatus] =1;
format(string, sizeof(string), "* %s %s", GetPlayerNameEx(playerid), message);
PlayerInfo[playerid][aMeID] = CreateDynamic3DTextLabel(string, COLOR_PURPLE, 0.0, 0.0, 0.0, 20.0, playerid);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
return 1;
}
else
{
format(string, sizeof(string), "* %s %s", GetPlayerNameEx(playerid), message);
UpdateDynamic3DTextLabelText(PlayerInfo[playerid][aMeID], COLOR_PURPLE, string);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
return 1;
}
}
CMD:ame(playerid, params[])
{
new activewep = GetPVarInt(playerid, "activesling");
new message[100], string[128];
if(sscanf(params, "s[100]", message))
return SendClientMessageEx(playerid, COLOR_GRAD2, "USAGE: /ame [action]");
if(activewep > 0)
return SendClientMessageEx(playerid, COLOR_GRAD2, " You have a weapon slung around your back, you can't use /ame.");
if(strlen(message) > 100) return SendClientMessageEx(playerid, COLOR_GRAD2, " The action is too long, please reduce the length.");
if(strlen(message) < 3) return SendClientMessageEx(playerid, COLOR_GRAD2, " The action is too short, please increase the length.");
format(string, sizeof(string), "* %s *", message);
SetPlayerChatBubble(playerid, string, COLOR_PURPLE, 7.0, 10000);
format(string, sizeof(string), "Annotated Message: %s", message);
SendClientMessageEx(playerid, COLOR_PURPLE, string);
return 1;
}
|
Hello! You don't actaully need to use a text label to achieve this; You can use the default chatbubble option already provided by SA-MP.
Here's an edit of your code that *should* work, however I haven't actually tested it ingame. Код:
CMD:ame(playerid, params[])
{
new activewep = GetPVarInt(playerid, "activesling");
new message[100], string[128];
if(sscanf(params, "s[100]", message))
return SendClientMessageEx(playerid, COLOR_GRAD2, "USAGE: /ame [action]");
if(activewep > 0)
return SendClientMessageEx(playerid, COLOR_GRAD2, " You have a weapon slung around your back, you can't use /ame.");
if(strlen(message) > 100) return SendClientMessageEx(playerid, COLOR_GRAD2, " The action is too long, please reduce the length.");
if(strlen(message) < 3) return SendClientMessageEx(playerid, COLOR_GRAD2, " The action is too short, please increase the length.");
format(string, sizeof(string), "* %s *", message);
SetPlayerChatBubble(playerid, string, COLOR_PURPLE, 7.0, 10000);
format(string, sizeof(string), "Annotated Message: %s", message);
SendClientMessageEx(playerid, COLOR_PURPLE, string);
return 1;
}
|
CMD:ame(playerid, params[])
{
new activewep = GetPVarInt(playerid, "activesling");
new message[100], string[128];
if(sscanf(params, "s[100]", message))
return SendClientMessageEx(playerid, COLOR_GRAD2, "USAGE: /ame [action]");
if(activewep > 0)
return SendClientMessageEx(playerid, COLOR_GRAD2, " You have a weapon slung around your back, you can't use /ame.");
if(strlen(message) > 100) return SendClientMessageEx(playerid, COLOR_GRAD2, " The action is too long, please reduce the length.");
if(strlen(message) < 3) return SendClientMessageEx(playerid, COLOR_GRAD2, " The action is too short, please increase the length.");
format(string, sizeof(string), "--> %s", message);
SetPlayerChatBubble(playerid, string, COLOR_PURPLE, 7.0, 10000);
format(string, sizeof(string), "--> %s", message);
SendClientMessageEx(playerid, COLOR_PURPLE, string);
return 1;
}
|
Hello, Tessa in game do you know how can i show the playername, I modified it alittle and it is at this now,
Код:
CMD:ame(playerid, params[])
{
new activewep = GetPVarInt(playerid, "activesling");
new message[100], string[128];
if(sscanf(params, "s[100]", message))
return SendClientMessageEx(playerid, COLOR_GRAD2, "USAGE: /ame [action]");
if(activewep > 0)
return SendClientMessageEx(playerid, COLOR_GRAD2, " You have a weapon slung around your back, you can't use /ame.");
if(strlen(message) > 100) return SendClientMessageEx(playerid, COLOR_GRAD2, " The action is too long, please reduce the length.");
if(strlen(message) < 3) return SendClientMessageEx(playerid, COLOR_GRAD2, " The action is too short, please increase the length.");
format(string, sizeof(string), "--> %s", message);
SetPlayerChatBubble(playerid, string, COLOR_PURPLE, 7.0, 10000);
format(string, sizeof(string), "--> %s", message);
SendClientMessageEx(playerid, COLOR_PURPLE, string);
return 1;
}
|
CMD:ame(playerid, params[])
{
new activewep = GetPVarInt(playerid, "activesling");
new message[100], string[128];
if(sscanf(params, "s[100]", message))
return SendClientMessageEx(playerid, COLOR_GRAD2, "USAGE: /ame [action]");
if(activewep > 0)
return SendClientMessageEx(playerid, COLOR_GRAD2, " You have a weapon slung around your back, you can't use /ame.");
if(strlen(message) > 100) return SendClientMessageEx(playerid, COLOR_GRAD2, " The action is too long, please reduce the length.");
if(strlen(message) < 3) return SendClientMessageEx(playerid, COLOR_GRAD2, " The action is too short, please increase the length.");
format(string, sizeof(string), "%s --> %s", pName(playerid), message);
SetPlayerChatBubble(playerid, string, COLOR_PURPLE, 10.0, 7000);
format(string, sizeof(string), "%s --> %s", pName(playerid), message);
SendClientMessageEx(playerid, COLOR_PURPLE, string);
return 1;
}
pName(playerid)
{
new pname[24];
GetPlayerName(playerid,pname,24);
return pname;
}