hrk Posted June 4, 2022 Share Posted June 4, 2022 Hello! I want to run these commands. I'm a beginer scripter and I dont know how can I make this. I tried to write a script , but its not working. Function visz (setPedFrozen, toggleAllControls, outputChatBox) setPedFrozen( client, true ) toggleAllControls( client, false ) outputChatBox("viszlek he") addCommandHandler("visz", visz) Link to comment
MTA.Castiel Posted June 4, 2022 Share Posted June 4, 2022 Hey there Hrk. I am a beginner scripter myself, i put a little code together you might find useful. --------------------------- -- Visz (Client) --------------------------- function viszFunc() toggleControl("next_weapon", false ) toggleControl("previous_weapon", false ) toggleControl("vehicle_fire", false) toggleControl("vehicle_secondary_fire", false) setPedFrozen(localPlayer, true ) outputChatBox("viszlek he") end addEvent("visz", true) addEventHandler("visz", localPlayer, viszFunc) function cleanUP() toggleControl("next_weapon", true ) toggleControl("previous_weapon", true ) toggleControl("vehicle_fire", true) toggleControl("vehicle_secondary_fire", true) setPedFrozen(localPlayer, false ) end addEventHandler("onClientResourceStart", resourceRoot, cleanUP) --------------------------- -- Visz (Server) --------------------------- function viszCommand(playerSource, commandName) triggerClientEvent(playerSource, "visz", playerSource) end addCommandHandler("visz", viszCommand) Link to comment
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