Tycka Posted December 12, 2014 Share Posted December 12, 2014 I need help with toggleAllControls, I try disable control to player when his fixing vehicle. I use this: toggleAllControls ( source, false) But I didn't disable and I get this warning: Bad argument @ 'toggleAllControls' [Expected player at argument 1, got nil] Link to comment
manawydan Posted December 12, 2014 Share Posted December 12, 2014 post your code, i think you source no is one player(Expected player at argument 1, got nil]) no exist Link to comment
Tycka Posted December 12, 2014 Author Share Posted December 12, 2014 post your code, i think you source no is one player(Expected player at argument 1, got nil]) no exist function repairVehicle (veh) if repairTimer[veh] then triggerClientEvent (source, "displayClientInfo", source,"Vehicle",getVehicleName(veh).." is currently being repaired!",255,22,0) return end local health = math.floor(getElementHealth(veh)) repairTimer[veh] = setTimer(fixVehicleDayZ,(1000-health)*120,1,veh,source) setElementFrozen (veh,true) setElementData(veh,"repairer",source) setElementData(source,"repairingvehicle",veh) setPedAnimation (source,"SCRATCHING","sclng_r",nil,true,false) toggleAllControls ( source, false ) --I used player, ThePlayer and it didn't work to triggerClientEvent (source, "displayClientInfo", source,"Vehicle","You started to repair "..getVehicleName(veh),22,255,0) end addEvent("repairVehicle",true) addEventHandler("repairVehicle",getRootElement(),repairVehicle) Link to comment
manawydan Posted December 12, 2014 Share Posted December 12, 2014 how you trigger this event? Link to comment
Tycka Posted December 12, 2014 Author Share Posted December 12, 2014 I fix it, but ty for try help manawydan 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