Jump to content

Need help


sckatchof

Recommended Posts

hi guys i have try to make script when i chat in los stantos it show like this :

(Ls)Sckatchof : my msg  

this is my script

Server Side :

local tab = 
{ 
    ['Los Santos']      = 'LS'; 
    ['Las Venturas']    = 'LV'; 
    ['San Fierro']      = 'SF'; 
} 
  
function chatbox(text, msgtype) 
    local account = getAccountName(getPlayerAccount(source)) 
    local name = getPlayerName(source) 
   local playerX, playerY, playerZ = getElementPosition ( player ) 
   local playerZoneName = getZoneName ( playerX, playerY, playerZ,true ) 
         if playerZoneName == 'Los Santos' or playerZoneName == 'Las Venturas' or playerZoneName == 'San Fierro' then 
           playerZoneName = tab[ playerZoneName ] 
            else 
                playerZoneName = 'None' 
            end 
    if (msgtype == 0) then 
            outputChatBox("(".. playerZoneName ..")".. name ..":".. text, root, 255, 255, 255, true) 
        end 
    end 
        cancelEvent ( ) 
  
addEventHandler("onPlayerChat", root, chatbox) 

Link to comment
local tab = 
{ 
    ['Los Santos']      = 'LS'; 
    ['Las Venturas']    = 'LV'; 
    ['San Fierro']      = 'SF'; 
} 
  
function chatbox(text, msgtype) 
    local account = getAccountName(getPlayerAccount(source)) 
    local name = getPlayerName(source) 
   local playerX, playerY, playerZ = getElementPosition ( source ) 
   local playerZoneName = getZoneName ( playerX, playerY, playerZ,true ) 
         if playerZoneName == 'Los Santos' or playerZoneName == 'Las Venturas' or playerZoneName == 'San Fierro' then 
           playerZoneName = tab[ playerZoneName ] 
            else 
                playerZoneName = 'None' 
            end 
    if (msgtype == 0) then 
            outputChatBox("(".. playerZoneName ..")".. name ..":".. text, root, 255, 255, 255, true) 
        end 
    end 
        cancelEvent ( ) 
  
addEventHandler("onPlayerChat", root, chatbox) 

is there any errors shown to you ?

if there are then post it here

Link to comment
local tab = 
{ 
    ['Los Santos']      = 'LS'; 
    ['Las Venturas']    = 'LV'; 
    ['San Fierro']      = 'SF'; 
} 
  
function chatbox(text, msgtype) 
    local account = getAccountName(getPlayerAccount(source)) 
    local name = getPlayerName(source) 
   local playerX, playerY, playerZ = getElementPosition ( source ) 
   local playerZoneName = getZoneName ( playerX, playerY, playerZ,true ) 
         if playerZoneName == 'Los Santos' or playerZoneName == 'Las Venturas' or playerZoneName == 'San Fierro' then 
           playerZoneName = tab[ playerZoneName ] 
            else 
                playerZoneName = 'None' 
            end 
    if (msgtype == 0) then 
            outputChatBox("(".. playerZoneName ..")".. name ..":".. text, root, 255, 255, 255, true) 
        end 
    end 
        cancelEvent ( ) 
        cancelEvent( ) 
  
addEventHandler("onPlayerChat", root, chatbox) 

if you are runing freeromm stop it and run stealth and test the script

Link to comment
local tab = 
{ 
    ['Los Santos']      = 'LS'; 
    ['Las Venturas']    = 'LV'; 
    ['San Fierro']      = 'SF'; 
} 
  
function chatbox(text, msgtype) 
    local account = getAccountName(getPlayerAccount(source)) 
    local name = getPlayerName(source) 
   local playerX, playerY, playerZ = getElementPosition ( source ) 
   local playerZoneName = getZoneName ( playerX, playerY, playerZ,true ) 
         if playerZoneName == 'Los Santos' or playerZoneName == 'Las Venturas' or playerZoneName == 'San Fierro' then 
           playerZoneName = tab[ playerZoneName ] 
            else 
                playerZoneName = 'None' 
            end 
    if (msgtype == 0) then 
            outputChatBox("(".. playerZoneName ..")".. name ..":".. text, root, 255, 255, 255, true) 
        end 
    end 
        cancelEvent ( ) 
        cancelEvent( ) 
  
addEventHandler("onPlayerChat", root, chatbox) 

if you are runing freeromm stop it and run stealth and test the script

still dont work but thank you for help .

Link to comment

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...