📱 Social Media Events
Y App
yseries:server:y:new-tweet
Triggered when a new tweet is posted on the Y app.
Event Data:
lua-- tweetData: { -- id = number, -- Tweet ID (insert ID from database) -- username = string, -- Username of the tweet author -- content = string, -- Tweet content/text -- attachments = table|nil, -- Attachments array (can be nil) -- replyTo = number|nil -- ID of tweet being replied to (can be nil for new tweets) -- } -- playerIdentifier: string|nil -- Player identifier (can be nil)
Usage Example:
luaRegisterNetEvent('yseries:server:y:new-tweet', function(tweetData, playerIdentifier) print("New tweet posted!") print("Tweet ID:", tweetData.id) print("Username:", tweetData.username) print("Content:", tweetData.content) -- Example: Log tweet to external system -- YourLoggingSystem:LogTweet(tweetData, playerIdentifier) -- Example: Trigger custom logic -- if string.find(tweetData.content, "keyword") then -- -- Do something -- end end)
Notes:
- The
attachmentsfield is a table/array that may contain photos or other media - The
replyTofield is set when replying to an existing tweet, otherwise it'snil - The
playerIdentifiercan benilif the player is not found
Instashots
yseries:server:instashots:on-new-post
Triggered when a new post is created on Instashots.
Event Data:
lua-- postData: { -- username = string, -- Username of the post author -- caption = string, -- Post caption/text -- attachments = { -- Attachments object -- media = string[], -- Array of media URLs/photos -- taggedPeople = string[]|nil -- Array of tagged usernames (can be nil) -- } -- } -- playerIdentifier: string|nil -- Player identifier (can be nil)
Note: The post ID is not included in the event data, but the post is already saved to the database when this event fires.
Usage Example:
luaRegisterNetEvent('yseries:server:instashots:on-new-post', function(postData, playerIdentifier) print("New Instashots post!") print("Username:", postData.username) print("Caption:", postData.caption) print("Media count:", #(postData.attachments.media or {})) -- Example: Process tagged people if postData.attachments.taggedPeople then for _, username in ipairs(postData.attachments.taggedPeople) do print("Tagged:", username) end end end)
Notes:
- The
attachments.mediafield is an array of media URLs/photos - The
attachments.taggedPeoplefield contains an array of usernames that were tagged in the post - Tagged people are automatically converted to usernames only (not full user objects)
News
yseries:server:news:new-article
Triggered when a new news article is created and published.
Event Data:
lua-- articleData: { -- id = number, -- Article ID (insert ID from database) -- title = string, -- Article title -- summary = string, -- Article summary -- content = string, -- Full article content -- imageUrls = string[]|nil, -- Array of image URLs (can be nil) -- categoryId = string, -- Article category ID -- authorId = string -- Author ID/name -- } -- playerIdentifier: string|nil -- Player identifier (can be nil)
Usage Example:
luaRegisterNetEvent('yseries:server:news:new-article', function(articleData, playerIdentifier) print("New news article published!") print("Article ID:", articleData.id) print("Title:", articleData.title) print("Category:", articleData.categoryId) print("Author:", articleData.authorId) -- Example: Broadcast to external systems -- YourNewsSystem:PublishArticle(articleData) end)
Notes:
- Only users with permission to create news articles can trigger this event
- The
imageUrlsfield is a JSON-encoded array of image URLs - The article is automatically broadcast to all clients after creation
YBuy (Marketplace)
yseries:server:ybuy:on-new-ad
Triggered when a new advertisement is created on YBuy marketplace.
Event Data:
lua-- adData: { -- title = string, -- Ad title -- description = string, -- Ad description -- category = string, -- Ad category -- price = number, -- Ad price -- contactName = string, -- Contact name -- number = string, -- Contact phone number -- allowMessages = boolean, -- Whether messages are allowed -- allowCalls = boolean, -- Whether calls are allowed -- attachments = string|nil -- JSON string of attachments (can be nil) -- } -- playerIdentifier: string|nil -- Player identifier (can be nil)
Usage Example:
luaRegisterNetEvent('yseries:server:ybuy:on-new-ad', function(adData, playerIdentifier) print("New YBuy ad created!") print("Title:", adData.title) print("Price:", adData.price) print("Category:", adData.category) -- Example: Index ad for search -- YourSearchSystem:IndexAd(adData) end)
Notes:
- The
attachmentsfield is a JSON-encoded string that needs to be decoded to access attachment data - The
pricefield is sanitized before being saved to the database - The ad is immediately available in the marketplace after creation
PromoHub
yseries:server:promoHub:on-new-ad
Triggered when a new promotional advertisement is created on PromoHub.
Event Data:
lua-- adData: { -- title = string, -- Ad title (max 50 characters) -- description = string, -- Ad description (max 5000 characters) -- price = number, -- Ad price -- contactNumber = string, -- Contact phone number -- contactName = string, -- Contact name (max 50 characters) -- attachments = string|nil -- JSON string of attachments (can be nil) -- } -- playerIdentifier: string|nil -- Player identifier (can be nil)
Usage Example:
luaRegisterNetEvent('yseries:server:promoHub:on-new-ad', function(adData, playerIdentifier) print("New PromoHub ad created!") print("Title:", adData.title) print("Price:", adData.price) print("Contact:", adData.contactName) -- Example: Send notification to admins -- AdminNotificationSystem:NotifyNewAd(adData) end)
Notes:
- Title and contact name are automatically trimmed to 50 characters
- Description is automatically trimmed to 5000 characters
- The
attachmentsfield is a JSON-encoded string that needs to be decoded to access attachment data