Jump to content

Help with toggleAllControls


Tycka

Recommended Posts

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

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