d43dr4 Posted December 7, 2012 Posted December 7, 2012 Hello everybody, I got two codes and i want to merge them on one code the first is a script, can give you a private vehicle addCommandHandler ( "vehicle", function ( thePlayer ) if isObjectInACLGroup ( "user." ..getAccountName ( getPlayerAccount ( thePlayer ) ), aclGetGroup ( "RPC" ) ) then x, y, z = getElementPosition ( thePlayer ) theVehicle = createVehicle ( 411, x, y + 3, z ) end end ) addEventHandler ( "onVehicleStartEnter", root, function ( thePlayer, theSeat ) if source == theVehicle then if ( theSeat == 0 ) and ( getPlayerName ( thePlayer ) ~= "#[iMr][E'rrOr]_N" ) then cancelEvent ( ) outputChatBox ( "~][ This car is private ][~", thePlayer, 255, 255, 0, true ) else outputChatBox ( "~][Welcome sir][~", thePlayer, 255, 0, 0, true ) end end end ) And here the second, make vehicle with proof damage ( infinite health ) setVehicleDamageProof ( getPedOccupiedVehicle ( getPlayerFromName ( "#[iMr][E'rrOr]_N" ) ), true ) Please help me if you can, Thx
manve1 Posted December 7, 2012 Posted December 7, 2012 addCommandHandler ( "vehicle", function ( thePlayer ) if isObjectInACLGroup ( "user." ..getAccountName ( getPlayerAccount ( thePlayer ) ), aclGetGroup ( "RPC" ) ) then x, y, z = getElementPosition ( thePlayer ) theVehicle = createVehicle ( 411, x, y + 3, z ) end end ) addEventHandler ( "onVehicleStartEnter", root, function ( thePlayer, theSeat ) if source == theVehicle then if ( theSeat == 0 ) and ( getPlayerName ( thePlayer ) ~= "#[iMr][E'rrOr]_N" ) then cancelEvent ( ) outputChatBox ( "~][ This car is private ][~", thePlayer, 255, 255, 0, true ) else outputChatBox ( "~][Welcome sir][~", thePlayer, 255, 0, 0, true ) setVehicleDamageProof( getPedOccupiedVehicle ( getPlayerFromName ( "#[iMr][E'rrOr]_N" ) ), true ) end end end )
d43dr4 Posted December 7, 2012 Author Posted December 7, 2012 Thx broo !! I want to know something .. What is the command to set stats on mta sa server
manve1 Posted December 7, 2012 Posted December 7, 2012 this you mean? ==> https://wiki.multitheftauto.com/wiki/SetPedStat
d43dr4 Posted December 7, 2012 Author Posted December 7, 2012 i want to make my health infinite so no one can kill me
manve1 Posted December 7, 2012 Posted December 7, 2012 addEventHandler('onPlayerDamage', getRootElement(), function( ) if ( getPlayerName( getPlayerFromName( "#[iMr][E'rrOr]_N" ) ) ) then cancelEvent() end end )
codeluaeveryday Posted December 7, 2012 Posted December 7, 2012 addEventHandler('onPlayerDamage', getRootElement(), function( ) if ( getPlayerName( getPlayerFromName( "#[iMr][E'rrOr]_N" ) ) ) then cancelEvent() end end ) Manve1 all I see from you is scripting mistakes, your code will make everyone in the the server god mode when a player is damaged. You need to make the god mode clientsided, and you should never rely on names, use serials / account. I understand your new to this, but he wants a solid working code.
d43dr4 Posted December 7, 2012 Author Posted December 7, 2012 addEventHandler('onPlayerDamage', getRootElement(), function( ) if ( getPlayerName( getPlayerFromName( "#[iMr][E'rrOr]_N" ) ) ) then cancelEvent() end end ) Manve1 all I see from you is scripting mistakes, your code will make everyone in the the server god mode when a player is damaged. You need to make the god mode clientsided, and you should never rely on names, use serials / account. I understand your new to this, but he wants a solid working code. If you think manve is like this, why you didnt give me a code ? Waiting
codeluaeveryday Posted December 7, 2012 Posted December 7, 2012 I am currently camping and I told manve so he would fix it, I got low reception too.
manve1 Posted December 8, 2012 Posted December 8, 2012 addEventHandler('onPlayerDamage', getRootElement(), function( ) if ( getPlayerName( getPlayerFromName( "#[iMr][E'rrOr]_N" ) ) ) then cancelEvent() end end ) Manve1 all I see from you is scripting mistakes, your code will make everyone in the the server god mode when a player is damaged. You need to make the god mode clientsided, and you should never rely on names, use serials / account. I understand your new to this, but he wants a solid working code. I'm not new, just at that point I was bit tired... after all, i don't know his serial or IP so i can't help him.
Castillo Posted December 8, 2012 Posted December 8, 2012 onPlayerDamage cannot be cancelled. You can make yourself god mode with this ( runcode ): --Client side ( /crun ): addEventHandler ( "onClientPlayerDamage", localPlayer, cancelEvent )
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