Burgershot
  • Home
  • Members
  • Team
  • Help
  • Search
  • Register
  • Login
  • Home
  • Members
  • Help
  • Search
Burgershot SA-MP Releases Libraries [Library] @mentiones

 
  • 0 Vote(s) - 0 Average
Library @mentiones
AbyssMorgan
Offline

Burgershot Member
Posts: 63
Threads: 25
Joined: Apr 2021
Reputation: 8
Location: Poland
#1
2021-04-18, 08:02 AM (This post was last modified: 2021-08-06, 04:12 PM by AbyssMorgan. Edit Reason: Update v1.3.1 )
Include contain function for chat @mentiones system

Code:
mentiones.inc
Copyright © 2021 Abyss Morgan. All rights reserved.
Contributors: None

Website: https://adm.ct8.pl

Plugins: SScanf
Modules: RGB, DataConvert

File Version: 1.3.1

Functions:
GetMentiones(playerid,text[],mention_color=0xCC0000FF,back_color=0xFFFFFFFF,max_len=sizeof(text));
GetAllowedMentions();
SetAllowedMentions(number);

Callbacks:
OnPlayerMentioned(playerid,targetid);

Example:
Code:
public OnPlayerMentioned(playerid,targetid){
    //create your own notice with TextDraw/sound
    return 1;
}

public OnPlayerText(playerid,text[]){
    new chat_text[2048], p_name[MAX_PLAYER_NAME];
    GetPlayerName(playerid,p_name,MAX_PLAYER_NAME);
    format(chat_text,sizeof(chat_text),"%s: %s",p_name,text);
    GetMentiones(playerid,chat_text,0xCC0000FF,0x00AA00FF,2048); //back_color the same as first chat color
    SendClientMessageToAll(0x00AA00FF,chat_text);
    return 0;
}
//Hi @Johny and @Alena how are you ?
//Two existing players got notice and nick color has been changed to 0xCC0000FF

Screenshot:
https://i.imgur.com/dhkbMWV.png

Download:
mentiones.inc
RGB.inc
DataConvert.inc
Radical
Offline

Burgershot Member
Posts: 148
Threads: 21
Joined: Dec 2020
Reputation: 16
#2
2021-05-23, 08:14 PM
Nice bro.

Can you create another function to convert @32 (player id)
to @AbyssMorgan (player name)?
AbyssMorgan
Offline

Burgershot Member
Posts: 63
Threads: 25
Joined: Apr 2021
Reputation: 8
Location: Poland
#3
2021-05-26, 04:24 PM
Update v1.3.0:

- Optimizations
- Added support for @id mentions
- Changed output for print full nick name

Screenshot
https://i.imgur.com/dhkbMWV.png
Radical
Offline

Burgershot Member
Posts: 148
Threads: 21
Joined: Dec 2020
Reputation: 16
#4
2021-07-15, 12:05 AM
There is a problem.
That function doesn't support more than 3 mentions.

Also It would be good if you add:
SetAllowedMentions(number);

I don't want players can mentioning more than 4 players. I want limit them.
AbyssMorgan
Offline

Burgershot Member
Posts: 63
Threads: 25
Joined: Apr 2021
Reputation: 8
Location: Poland
#5
2021-08-06, 04:13 PM
Update v1.3.1:

- Added functions:
Code:
GetAllowedMentions();
SetAllowedMentions(number);
« Next Oldest | Next Newest »



  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

© Burgershot - Powered by our Community and MyBB Original Theme by Emerald

Linear Mode
Threaded Mode