TheJamcof Posted June 6, 2014 Posted June 6, 2014 I am bad with scripts but I try my best (, I am just training). I tried to make script. And the idea was When some player will type command "fix" then her vehicle will be fixed. bool fixVehicle ( vehicle theVehicle ) addCommandHandler ( string "fix", function handlerFunction, [bool restricted = false, bool caseSensitive = true] ) Sorry about my bad english I hope I will get answer pretty fast, Thank you.
Max+ Posted June 6, 2014 Posted June 6, 2014 function fix () local theVehicle = getPedOccupiedVehicle (localPlayer) if ( theVehicle ) then fixVehicle (theVehicle) outputChatBox ("Your vehicle has been fixed !" , localPlayer) end end addCommandHandler ("fix" , fix) - 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
ViRuZGamiing Posted June 6, 2014 Posted June 6, 2014 (edited) Bool isn't something you're supposed to write. you'll need something like this; function fixVeh (thePlayer) local theVehicle = getPlayerVehicle ( thePlayer ) if theVehicle then fixVehicle(theVehicle) else outputChatBox("You don't have vehicle", thePlayer) end addCommandHandler("fix", fixVeh) not tested. Edited June 6, 2014 by Guest "If debugging is the process of removing software bugs, then programming must be the process of putting them in."
ViRuZGamiing Posted June 6, 2014 Posted June 6, 2014 function fix () local theVehicle = getPedOccupiedVehicle (localPlayer) if ( theVehicle ) then fixVehicle (theVehicle) outputChatBox ("Your vehicle has been fixed !" , localPlayer) end end addCommandHandler ("fix" , fix) Lol you were faster "If debugging is the process of removing software bugs, then programming must be the process of putting them in."
Max+ Posted June 6, 2014 Posted June 6, 2014 Bool isn't something you're supposed to write.you'll need something like this; function fixVeh local vehicle = getPlayerVehicle ( player ) if vehicle then fixVehicle(vehicle) else outputChatBox("You don't have vehicle", thePlayer) end addCommandHandler("fix", fixVeh) not tested. getPlayerVehicle ( player ) -- not function name like this , and player isn't defined outputChatBox("You don't have vehicle", thePlayer) thPlayer, isn't defined - 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
ViRuZGamiing Posted June 6, 2014 Posted June 6, 2014 Edited, how 'bout now? "If debugging is the process of removing software bugs, then programming must be the process of putting them in."
Jaysds1 Posted June 6, 2014 Posted June 6, 2014 Try this: addCommandHandler("fix", function(player) if isPedInVehicle(player) then local vehicle = getPedOccupiedVehicle(player) fixVehicle(vehicle) outputChatBox ("Your vehicle has been fixed !" , localPlayer) end end ) My in-game name: Jaysds1 Retired CMG Scripter World Of Tanks GameMode (Open-Source): https://github.com/Jaysds1/mtasa-wot-gamemode Online GUI-Editor (WIP): https://forum.mtasa.com/topic/47678-online-gui-editor/
TheJamcof Posted June 6, 2014 Author Posted June 6, 2014 Try this:addCommandHandler("fix", function(player) if isPedInVehicle(player) then local vehicle = getPedOccupiedVehicle(player) fixVehicle(vehicle) outputChatBox ("Your vehicle has been fixed !" , localPlayer) end end ) Thx lot of! This is working.
Jaysds1 Posted June 6, 2014 Posted June 6, 2014 No Problem My in-game name: Jaysds1 Retired CMG Scripter World Of Tanks GameMode (Open-Source): https://github.com/Jaysds1/mtasa-wot-gamemode Online GUI-Editor (WIP): https://forum.mtasa.com/topic/47678-online-gui-editor/
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