Jump to content

bind


Nerses

Recommended Posts

help to write a function that binds this script. Do not judge strictly, I'm still learning:)

--[[------------------- 
CLEAR CHAT 
  
By: lLinux (HackerlLinux) 
To: [url=https://community.multitheftauto.com/]https://community.multitheftauto.com/[/url] 
  
Contanct: 
  
Skype: lLinux 
Facebook: [url=http://www.facebook.com/lLinux]www.facebook.com/lLinux[/url] 
---- 
Please do not delete the copyright 
]]--------------------- 
  
function clear ( thePlayer ) 
local cuenta = getAccountName( getPlayerAccount(thePlayer) ) 
if isObjectInACLGroup("user."..cuenta, aclGetGroup("Admin")) then --Group Admin 
    spaces(thePlayer) 
elseif isObjectInACLGroup("user."..cuenta, aclGetGroup("SuperModerator")) then --Group SuperModerator 
    spaces(thePlayer) 
elseif isObjectInACLGroup("user."..cuenta, aclGetGroup("Moderator")) then --Group Moderator 
    spaces(thePlayer) 
else 
outputChatBox("ACCESS DENIED!!", thePlayer, 255, 0, 0, true) -- For those that are not 
end 
end 
addCommandHandler("clearchat", clear) 
function spaces(thePlayer) 
outputChatBox(" ") 
outputChatBox(" ") 
outputChatBox(" ") 
outputChatBox(" ") 
outputChatBox(" ") 
outputChatBox(" ") 
outputChatBox(" ") 
outputChatBox(" ") 
outputChatBox(" ") 
outputChatBox(" ") 
outputChatBox(" ") 
outputChatBox(" ") 
outputChatBox(" ") 
outputChatBox(" ") 
outputChatBox(" ") 
outputChatBox(" ") 
outputChatBox(" ") 
outputChatBox("#00B3C7[serever [bP] ] #00FF04Чат был очищен #FF0000 "..getPlayerName(thePlayer), getRootElement(), 255, 255, 255, true) 
end 

Link to comment
--[[------------------- 
CLEAR CHAT 
  
By: lLinux (HackerlLinux) 
To: [url=https://community.multitheftauto.com/]https://community.multitheftauto.com/[/url] 
  
Contanct: 
  
Skype: lLinux 
Facebook: [url=http://www.facebook.com/lLinux]www.facebook.com/lLinux[/url] 
---- 
Please do not delete the copyright 
]]--------------------- 
  
local Bind = "C" 
  
function clear ( thePlayer ) 
    local cuenta = getAccountName( getPlayerAccount(thePlayer) ) 
    if isObjectInACLGroup("user."..cuenta, aclGetGroup("Admin")) then --Group Admin 
        spaces(thePlayer) 
    elseif isObjectInACLGroup("user."..cuenta, aclGetGroup("SuperModerator")) then --Group SuperModerator 
        spaces(thePlayer) 
    elseif isObjectInACLGroup("user."..cuenta, aclGetGroup("Moderator")) then --Group Moderator 
        spaces(thePlayer) 
    else 
        outputChatBox("ACCESS DENIED!!", thePlayer, 255, 0, 0, true) -- For those that are not 
    end 
end 
addCommandHandler("clearchat", clear) 
  
  
function spaces(thePlayer) 
outputChatBox(" ") 
outputChatBox(" ") 
outputChatBox(" ") 
outputChatBox(" ") 
outputChatBox(" ") 
outputChatBox(" ") 
outputChatBox(" ") 
outputChatBox(" ") 
outputChatBox(" ") 
outputChatBox(" ") 
outputChatBox(" ") 
outputChatBox(" ") 
outputChatBox(" ") 
outputChatBox(" ") 
outputChatBox(" ") 
outputChatBox(" ") 
outputChatBox(" ") 
outputChatBox("#00B3C7[serever [bP] ] #00FF04Чат был очищен #FF0000 "..getPlayerName(thePlayer), getRootElement(), 255, 255, 255, true) 
end 
  
addEventHandler("onPlayerJoin",root, 
function() 
    bindKey(source,Bind,"down","clearchat") 
end) 
  
addEventHandler("onResourceStart",root, 
function() 
    local players = getElementsByType("player") 
    for i,v in ipairs(players) do 
        bindKey(v,Bind,"down","clearchat") 
    end 
end) 

Link to comment
--[[------------------- 
CLEAR CHAT 
  
By: lLinux (HackerlLinux) 
To: [url=https://community.multitheftauto.com/]https://community.multitheftauto.com/[/url] 
  
Contanct: 
  
Skype: lLinux 
Facebook: [url=http://www.facebook.com/lLinux]http://www.facebook.com/lLinux[/url] 
---- 
Please do not delete the copyright 
]]--------------------- 
  
local Bind = "C" 
  
function clear ( thePlayer ) 
    local cuenta = getAccountName( getPlayerAccount(thePlayer) ) 
    if isObjectInACLGroup("user."..cuenta, aclGetGroup("Admin")) then --Group Admin 
        spaces(thePlayer) 
    elseif isObjectInACLGroup("user."..cuenta, aclGetGroup("SuperModerator")) then --Group SuperModerator 
        spaces(thePlayer) 
    elseif isObjectInACLGroup("user."..cuenta, aclGetGroup("Moderator")) then --Group Moderator 
        spaces(thePlayer) 
    else 
        outputChatBox("ACCESS DENIED!!", thePlayer, 255, 0, 0, true) -- For those that are not 
    end 
end 
addCommandHandler("clearchat", clear) 
  
  
function spaces(thePlayer) 
outputChatBox(" ") 
outputChatBox(" ") 
outputChatBox(" ") 
outputChatBox(" ") 
outputChatBox(" ") 
outputChatBox(" ") 
outputChatBox(" ") 
outputChatBox(" ") 
outputChatBox(" ") 
outputChatBox(" ") 
outputChatBox(" ") 
outputChatBox(" ") 
outputChatBox(" ") 
outputChatBox(" ") 
outputChatBox(" ") 
outputChatBox(" ") 
outputChatBox(" ") 
outputChatBox("#00B3C7[serever [bP] ] #00FF04Чат был очищен #FF0000 "..getPlayerName(thePlayer), getRootElement(), 255, 255, 255, true) 
end 
  
addEventHandler("onPlayerJoin",root, 
function() 
    bindKey(source,Bind,"down","clearchat") 
end) 
  
addEventHandler("onResourceStart",root, 
function() 
    local players = getElementsByType("player") 
    for i,v in ipairs(players) do 
        bindKey(v,Bind,"down","clearchat") 
    end 
end) 

Thank you very much. But now I have another question. The mechanic's job is to fix the machine with the command /fix . On the server there are intelligent which binds this team and with this money to the ceiling do. How can I resolve this problem? Here is the script:

--------------------Работа механиком----------------- 
  
  
  
blipSF = createBlip ( -1923.9658203125, 299.296875, 41.046875, 56 ) 
blipLS = createBlip ( 1035.0380859375, -1026.3212890625, 32.1015625, 56 ) 
blipLV = createBlip ( 2116.322265625, 960.310546875, 10.8203125, 56 ) 
mechanicSF = createPickup (-1923.9658203125, 299.296875, 41.046875, 3, 1275, 1000 ) 
mechanicLS = createPickup (1035.0380859375, -1026.3212890625, 32.1015625, 3, 1275, 1000 ) 
mechanicLV = createPickup (2116.322265625, 960.310546875, 10.8203125, 3, 1275, 1000 ) 
infomehSF = createPickup (-1924.1181640625, 293.404296875, 41.046875, 3, 1239, 1000 ) 
infomehLS = createPickup (1034.1005859375, -1030.755859375, 32.039329528809, 3, 1239, 1000 ) 
infomehLV = createPickup (2115.5634765625, 953.396484375, 10.8203125, 3, 1239, 1000 ) 
  
  
teammechanic = createTeam ( "Механик", 255, 255, 0 ) 
  
----------------Работа механиком в SF---------------- 
function mechanicjobSF ( thePlayer ) 
 local playerTeam = getPlayerTeam ( thePlayer ) 
    if ( playerTeam == teammechanic ) then 
        setElementModel ( thePlayer, 0 ) 
        setPlayerTeam ( thePlayer, nil ) 
        outputChatBox ( "Вы уволились с работы!", thePlayer, 255, 0, 0 ) 
        destroyElement ( mehanicvehicle ) 
    else 
        mehanicvehicle = createVehicle ( 525, -1919.5849609375, 290.1240234375, 41.046875 ) 
        setElementModel ( thePlayer, 50 ) 
        setPlayerTeam ( thePlayer, teammechanic ) 
        takeAllWeapons ( thePlayer ) 
        setPedArmor ( thePlayer, 0 ) 
        outputChatBox ( "Вы новый механик!", thePlayer, 0, 255, 0 ) 
        outputChatBox ( "Что бы отремонтировать транспорт, сядьте в него и напишите /fix.", thePlayer, 0, 255, 0 ) 
        outputChatBox ( "За каждый ремонт вы будете получать 350$", thePlayer, 0, 255, 0 ) 
    end 
end 
addEventHandler ( "onPickupUse", mechanicSF, mechanicjobSF ) 
  
  
function mechanicinfo ( thePlayer ) 
local x, y, z = getElementPosition (thePlayer) 
  outputChatBox ( "-------------------------------Работа механиком!-------------------------------", thePlayer ) 
  outputChatBox ( "--------Вы можете ремонтировать машины играков и получать за это деньги--------", thePlayer ) 
  outputChatBox ( "----------------Что бы уволится пройдите по маркеру работы снова---------------", thePlayer ) 
end 
addEventHandler ( "onPickupUse", infomehSF, mechanicinfo ) 
----------------Работа механиком в SF---------------- 
  
----------------Работа механиком в LS---------------- 
function mechanicjobLS ( thePlayer ) 
 local playerTeam = getPlayerTeam ( thePlayer ) 
    if ( playerTeam == teammechanic ) then 
        setElementModel ( thePlayer, 0 ) 
        setPlayerTeam ( thePlayer, nil ) 
        outputChatBox ( "Вы уволились с работы!", thePlayer, 255, 0, 0 ) 
        destroyElement ( mehanicvehicle ) 
    else 
        mehanicvehicle = createVehicle ( 525, 1038.7919921875, -1032.2236328125, 31.990514755249 ) 
        setElementModel ( thePlayer, 50 ) 
        setPlayerTeam ( thePlayer, teammechanic ) 
        takeAllWeapons ( thePlayer ) 
        setPedArmor ( thePlayer, 0 ) 
        outputChatBox ( "Вы новый механик!", thePlayer, 0, 255, 0 ) 
        outputChatBox ( "Что бы отремонтировать транспорт, сядьте в него и напишите /fix.", thePlayer, 0, 255, 0 ) 
        outputChatBox ( "За каждый ремонт вы будете получать 350$", thePlayer, 0, 255, 0 ) 
    end 
end 
addEventHandler ( "onPickupUse", mechanicLS, mechanicjobLS ) 
  
  
function mechanicinfo ( thePlayer ) 
local x, y, z = getElementPosition (thePlayer) 
  outputChatBox ( "-------------------------------Работа механиком!-------------------------------", thePlayer ) 
  outputChatBox ( "--------Вы можете ремонтировать машины играков и получать за это деньги--------", thePlayer ) 
  outputChatBox ( "----------------Что бы уволится пройдите по маркеру работы снова---------------", thePlayer ) 
end 
addEventHandler ( "onPickupUse", infomehLS, mechanicinfo ) 
----------------Работа механиком в LS---------------- 
  
----------------Работа механиком в LV---------------- 
function mechanicjobLV ( thePlayer ) 
 local playerTeam = getPlayerTeam ( thePlayer ) 
    if ( playerTeam == teammechanic ) then 
        setElementModel ( thePlayer, 0 ) 
        setPlayerTeam ( thePlayer, nil ) 
        outputChatBox ( "Вы уволились с работы!", thePlayer, 255, 0, 0 ) 
        destroyElement ( mehanicvehicle ) 
    else 
        mehanicvehicle = createVehicle ( 525, 2118.78515625, 950.4462890625, 10.81298828125 ) 
        setElementModel ( thePlayer, 50 ) 
        setPlayerTeam ( thePlayer, teammechanic ) 
        takeAllWeapons ( thePlayer ) 
        setPedArmor ( thePlayer, 0 ) 
        outputChatBox ( "Вы новый механик!", thePlayer, 0, 255, 0 ) 
        outputChatBox ( "Что бы отремонтировать транспорт, сядьте в него и напишите /fix.", thePlayer, 0, 255, 0 ) 
        outputChatBox ( "За каждый ремонт вы будете получать 350$", thePlayer, 0, 255, 0 ) 
    end 
end 
addEventHandler ( "onPickupUse", mechanicLV, mechanicjobLV ) 
  
  
function mechanicinfo ( thePlayer ) 
local x, y, z = getElementPosition (thePlayer) 
  outputChatBox ( "-------------------------------Работа механиком!-------------------------------", thePlayer ) 
  outputChatBox ( "--------Вы можете ремонтировать машины играков и получать за это деньги--------", thePlayer ) 
  outputChatBox ( "----------------Что бы уволится пройдите по маркеру работы снова---------------", thePlayer ) 
end 
addEventHandler ( "onPickupUse", infomehLV, mechanicinfo ) 
----------------Работа механиком в LV---------------- 
  
  
  
  
function fixCar (thePlayer,command) 
    local playerTeam = getPlayerTeam ( thePlayer ) 
    local vehicle = getPedOccupiedVehicle(thePlayer) 
        if ( playerTeam == teammechanic ) then 
                if (vehicle) and (playerTeam == teammechanic) then 
                    fixVehicle(vehicle) 
                    givePlayerMoney(thePlayer,350) 
                    outputChatBox ( "Ваш заработок 350$", thePlayer, 0, 255, 0 ) 
                end 
        end 
end 
addCommandHandler("fix" , fixCar) 
  
  
mechanicVehicles = { [525]=true } 
mechanicSkins = { [50]=true } 
  
function mechanicenterVehicle ( thePlayer, seat, jacked ) 
    if ( mechanicVehicles[getElementModel ( source )] ) and ( not mechanicSkins[getElementModel ( thePlayer )] ) and ( seat == 0 ) then 
        removePedFromVehicle ( thePlayer ) 
        outputChatBox ( "Вы не работаете механиком!", thePlayer, 255, 0, 0  ) 
    end 
end 
addEventHandler ( "onVehicleEnter", getRootElement(), mechanicenterVehicle ) 
  
  
  
  

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