Ballasbuster Posted February 15, 2011 Share Posted February 15, 2011 Hi guys, I have a lot problems with scritpting . I made script with RemovePlayerFromVehicle , but this resource doesn't work... local policevehicles = { [596]=true, [528]=true, [597]=true, [598]=true, [599]=true, [427]=true, [601]=true, [490]=true, [497]=true, [523]=true } local policeskins = { [280]=true, [143]=true } function enterVehicle ( theVehicle, seat, jacked ) local skinID = getPlayerSkin ( source ) local vehID = getVehicleID ( theVehicle ) if policevehicles[vehID] and not policeskins[skinID] then removePlayerFromVehicle ( source ) outputChatBox ( "You haven't rights.!", source ) end end addEventHandler ( "onPlayerEnterVehicle", getRootElement(), enterVehicle ) local taxivehicles = { [420]=true, [438]=true } local taxiskins = { [20]=true, [143]=true } function enterVehicle ( theVehicle, seat, jacked ) local skinID = getPlayerSkin ( source ) local vehID = getVehicleID ( theVehicle ) if taxivehicles[vehID] and not taxiskins[skinID] then removePlayerFromVehicle ( source ) outputChatBox ( "You haven't rights.!", source ) end end addEventHandler ( "onPlayerEnterVehicle", getRootElement(), enterVehicle ) local mechanicvehicles = { [487]=true, [443]=true, [487]=true, [525]=true, [530]=true, [522]=true, [574]=true, [578]=true, [583]=true } local mechanicskins = { [16]=true, [143]=true } function enterVehicle ( theVehicle, seat, jacked ) local skinID = getPlayerSkin ( source ) local vehID = getVehicleID ( theVehicle ) if mechanicvehicles[vehID] and not mechanicskins[skinID] then removePlayerFromVehicle ( source ) outputChatBox ( "You haven't rights.!", source ) end end addEventHandler ( "onPlayerEnterVehicle", getRootElement(), enterVehicle ) local medicvehicles = { [563]=true, [416]=true } local medicskins = { [274]=true, [143]=true } function enterVehicle ( theVehicle, seat, jacked ) local skinID = getPlayerSkin ( source ) local vehID = getVehicleID ( theVehicle ) if medicvehicles[vehID] and not medicskins[skinID] then removePlayerFromVehicle ( source ) outputChatBox ( "You haven't rights.!", source ) end end addEventHandler ( "onPlayerEnterVehicle", getRootElement(), enterVehicle ) local beervehicles = { [584]=true, [435]=true, [450]=true, [591]=true, [403]=true, [514]=true, [515]=true, } local beerskins = { [202]=true, [143]=true } function enterVehicle ( theVehicle, seat, jacked ) local skinID = getPlayerSkin ( source ) local vehID = getVehicleID ( theVehicle ) if beervehicles[vehID] and not beerskins[skinID] then removePlayerFromVehicle ( source ) outputChatBox ( "You haven't rights.!", source ) end end addEventHandler ( "onPlayerEnterVehicle", getRootElement(), enterVehicle ) local dilervehicles = { [414]=true, [413]=true, [428]=true, [440]=true, [456]=true, [482]=true, [498]=true, [499]=true, [609]=true } local dilerskins = { [143]=true } function enterVehicle ( theVehicle, seat, jacked ) local skinID = getPlayerSkin ( source ) local vehID = getVehicleID ( theVehicle ) if dilervehicles[vehID] and not dilerskins[skinID] then removePlayerFromVehicle ( source ) outputChatBox ( "You haven't rights.!", source ) end end addEventHandler ( "onPlayerEnterVehicle", getRootElement(), enterVehicle ) Please Help me Link to comment
12p Posted February 15, 2011 Share Posted February 15, 2011 Please, explain me again. What is the problem? Did you debugged the script? "/debugscript 3" may help. If no errors are showed, check with some outputChatBox in some parts of the code, maybe you will find the problem and you will know what to do with non-working scripts Link to comment
Ballasbuster Posted February 15, 2011 Author Share Posted February 15, 2011 Please, explain me again. What is the problem? Did you debugged the script? "/debugscript 3" may help. If no errors are showed, check with some outputChatBox in some parts of the code, maybe you will find the problem and you will know what to do with non-working scripts my resource doesn't work at all Link to comment
12p Posted February 15, 2011 Share Posted February 15, 2011 Ok... You can't start it? Link to comment
Ballasbuster Posted February 15, 2011 Author Share Posted February 15, 2011 I start this script but doesn't work. Link to comment
Aibo Posted February 15, 2011 Share Posted February 15, 2011 https://wiki.multitheftauto.com/wiki/Rem ... romVehicle read this for a start. especially red rectangle notice. so you've copied example code from wiki, but why you have 6 functions with the same name? PS: its onPlayerVehicleEnter, not onPlayerEnterVehicle Link to comment
Martyz Posted February 15, 2011 Share Posted February 15, 2011 Why the hell u make: blah = { [411]=true, [412]=true } not blah = {411, 412} and u make many different functions with same names.. ;D Link to comment
Aibo Posted February 15, 2011 Share Posted February 15, 2011 Why the hell u make: blah = { [411]=true, [412]=true } not blah = {411, 412} because he is checking table keys, not values. Link to comment
proracer Posted February 15, 2011 Share Posted February 15, 2011 Change removePlayerFromVehicle to removePedFromVehicle Link to comment
Aibo Posted February 15, 2011 Share Posted February 15, 2011 or better use onVehicleStartEnter 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