Jump to content

triggerClientEvent


SkatCh

Recommended Posts

Posted

hi guys please i need some help here :

server side:

function sendMessage( text, player, r, g, b ) 
    triggerClientEvent("sendMessage",player,text, r, g, b ) 
end 

client side:

function sMessage(text, r, g, b ) 
    local x, y, z = getPedBonePosition( localPlayer, 4 ) 
    local sx, sy = getScreenFromWorldPosition( x, y, z+0.5 ) 
    local sM = { text = text, r = r, g = g, b = b, a = 0,  
        visibleTick = false, fadingIn = true, fadingOut = false, startY = sy } 
    table.insert( Messages, sM ) 
end 
addEvent( "sendMessage", true ) 
addEventHandler( "sendMessage", root, sMessage) 

Error : cc15f25f39.jpg

Failure is simply an opportunity to begin again more intelligently - Henry Ford

Posted

The server side doesn't start without event,

function sendMessage( text, player, r, g, b ) 
    triggerClientEvent("sendMessage",player,text, r, g, b ) 
end 
  
addEventHandler("onResourceStart, root, sendMessage) 
 

maybe you just forgot it on the forum, idk, but anyway.

"If debugging is the process of removing software bugs, then programming must be the process of putting them in."

Posted
The server side doesn't start without event,
function sendMessage( text, player, r, g, b ) 
    triggerClientEvent("sendMessage",player,text, r, g, b ) 
end 
  
addEventHandler("onResourceStart, root, sendMessage) 
  
  
 

maybe you just forgot it on the forum, idk, but anyway.

Worng ,

---ClientSide 
addEvent ('sendMessage' , true ) 
addEventHandler ( 'sendMessage', root ,  
  function  ( text, r, g, b ) 
  local x, y, z =  getPedBonePosition ( localPlayer, 4 )  
  local sx, sy = getScreenFromWorldPosition ( x, y, z , 0.5 ) 
  local sM = { text = text, r = r, g = g, b = b, a = 0, visibleTick = false, fadingIn = true, fadingOut = false, startY = sy } 
  table.insert( Messages, sM ) 
     end 
   ) 
    
----ServerSide 
  addEventHandler('onPlayerChat', root , --- you can change it to your event 
   function ( text, r, g, b ) 
   triggerClientEvent (source, 'sendMessage', source, text, r, g, b ) 
   end 
 ) 

- New , Kill System

- New, GameMode Intro

- Leve / Exp System

- New nametag showing style

- New , Hud For Players

- Skin Selection from SA-MP

- Money System / Buy Weapons

- Drop Weapons

- New, Flood System

- New , Group Assign

- Gun license For Weapons

- Random Rule System For Money

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...