golanu21 Posted March 24, 2013 Posted March 24, 2013 how i make the /me command to be on local ??. radius = 100 [Dev]BloWnRPG - We BloW the World [1%]
Ab-47 Posted March 24, 2013 Posted March 24, 2013 Learn to script would be a first. Here's the wiki: https://wiki.multitheftauto.com/ And now Aurora is back again, pm for more info. Ex. Lead dev & L6 Staff at AUR, NGC, MTA RP & SAA. Ex. Developer at Community of Social Gamers - CSG Ex Founder of International Gaming Community - IGC and Union of Individual Players- UIP Ab-47
golanu21 Posted March 24, 2013 Author Posted March 24, 2013 man please, you know how to make it in local ? [Dev]BloWnRPG - We BloW the World [1%]
Castillo Posted March 24, 2013 Posted March 24, 2013 Cancel the default message at: onPlayerChat With: cancelEvent Then, you can create your own local /me chat. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
golanu21 Posted March 24, 2013 Author Posted March 24, 2013 but when i use cancelEvent for command /me, i can't create other function with /me [Dev]BloWnRPG - We BloW the World [1%]
Castillo Posted March 24, 2013 Posted March 24, 2013 You can do it. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
golanu21 Posted March 24, 2013 Author Posted March 24, 2013 (edited) i try it like that chat_rangee=100 function isPlayerInRangeOfPoint(player,xx,yy,zz,rangee) local pxx,pyy,pzz=getElementPosition(player) return ((xx-pxx)^2+(yy-pyy)^2+(zz-pzz)^2)^0.5<=rangee end function onChat(player,_,...) local pxx,pyy,pzz=getElementPosition(player) local msgg = table.concat({...}, " ") local nickk=getPlayerName(player) for _,c in ipairs(getElementsByType("player")) do if isPlayerInRangeOfPoint(c,pxx,pyy,pzz,chat_rangee) then outputChatBox( "#00ffff *"..nickk.." "..msgg,c,r,g,b,true) end end end addCommandHandler("me",onChat) addEventHandler ( "onPlayerChat", root, function ( message ) if message == me then cancelEvent ( ) end end ) Edited March 24, 2013 by Guest [Dev]BloWnRPG - We BloW the World [1%]
Castillo Posted March 24, 2013 Posted March 24, 2013 That's wrong, firstly, you never defined "messageType" at your function, also, the type isn't "me", is 1. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
codeluaeveryday Posted March 25, 2013 Posted March 25, 2013 Please learn from this code I just baked in my oven. chatRadius = 30 addEventHandler('onPlayerChat', getRootElement(), function(message, mType) if mType == 1 then cancelEvent() local posX, posY, posZ = getElementPosition(source) local chatSphere = createColSphere(posX, posY, posZ, chatRadius) local nearbyPlayers = getElementsWithinColShape(chatSphere, "player") destroyElement(chatSphere) for i, v in ipairs(nearbyPlayers) do outputChatBox('* '..getPlayerName(v):gsub('#%x%x%x%x%x%x', '')..' '..message:gsub('#%x%x%x%x%x%x', ''), v, 255, 0, 255) end end end ) Tutorials: => getOnlineAdmins() => [TUT] Better Join Country => [TUT] Updating admin countries => [TUT] Updating admin flags Server: K@N Zombies / Freeroam
golanu21 Posted March 25, 2013 Author Posted March 25, 2013 Please learn from this code I just baked in my oven. chatRadius = 30 addEventHandler('onPlayerChat', getRootElement(), function(message, mType) if mType == 1 then cancelEvent() local posX, posY, posZ = getElementPosition(source) local chatSphere = createColSphere(posX, posY, posZ, chatRadius) local nearbyPlayers = getElementsWithinColShape(chatSphere, "player") destroyElement(chatSphere) for i, v in ipairs(nearbyPlayers) do outputChatBox('* '..getPlayerName(v):gsub('#%x%x%x%x%x%x', '')..' '..message:gsub('#%x%x%x%x%x%x', ''), v, 255, 0, 255) end end end ) thanx man [Dev]BloWnRPG - We BloW the World [1%]
codeluaeveryday Posted March 25, 2013 Posted March 25, 2013 Your welcome friend. Tutorials: => getOnlineAdmins() => [TUT] Better Join Country => [TUT] Updating admin countries => [TUT] Updating admin flags Server: K@N Zombies / Freeroam
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now