d43dr4 Posted December 5, 2012 Share Posted December 5, 2012 Hello guys ... How r yah ! I want to ask about some codes ... a friend comes to my server and he asked me for an admin must have Resources Tag I give him , and after i see a wonderful thing He spawn a vehicle had infinity Health and dont explode never .. and throw too many grenades , set his name arabic ________________________________________________________________________ When i asked him he give me this code but he didnt tell me how to do it ( about vehicle ) : SetVehicleDamageProof I searched on wiki , but i dont know how to do it ? please teach me this and how to do the other actions ( Without create a script and add to server ) Thx .. Link to comment
Castillo Posted December 5, 2012 Share Posted December 5, 2012 You can create a command to turn your vehicle with damage proof with the following functions: addCommandHandler getPedOccupiedVehicle setVehicleDamageProof Link to comment
d43dr4 Posted December 5, 2012 Author Share Posted December 5, 2012 Im new on scripting bro i dont know how please tell me what to type on Resources ~> Client / Server Link to comment
d43dr4 Posted December 5, 2012 Author Share Posted December 5, 2012 still not infinity health ! What type on Server Side Castillo ? Link to comment
Castillo Posted December 5, 2012 Share Posted December 5, 2012 Show us what you tried. Link to comment
d43dr4 Posted December 5, 2012 Author Share Posted December 5, 2012 i Type setVehicleDamageProof and i press on server On chat showed : Command executed! Result: function: 03B02CA8 But the vehicle health still decreased .. Link to comment
Castillo Posted December 5, 2012 Share Posted December 5, 2012 Because that's not what you have to do, you have to get the vehicle of the player you are trying to set the damage proof to. Link to comment
d43dr4 Posted December 5, 2012 Author Share Posted December 5, 2012 What should i type , im not a scripter *-* I have Vehicle Sultan ( ID : 560 ) Link to comment
Castillo Posted December 5, 2012 Share Posted December 5, 2012 You can do this: setVehicleDamageProof ( getPedOccupiedVehicle ( getPlayerFromName ( "INSERTPLAYERNAME" ) ), true ) Link to comment
d43dr4 Posted December 5, 2012 Author Share Posted December 5, 2012 Thx Castillo , now how to change the name ( name that shown on players stomache ) ^^ Or how to make this vehicle private for me ( If someone try to enter said : this is not yous ) Link to comment
Castillo Posted December 5, 2012 Share Posted December 5, 2012 If you want to learn how to make more stuff, then you better start learning. viewtopic.php?f=148&t=40809 Link to comment
deltamta Posted December 7, 2012 Share Posted December 7, 2012 Hi I made a nice version which you can do /collide [which player you should collide] [yes or no] and only admins can set collisions on and off! It might not work though cause I made it in school and didn't have a chance to test it! If it doesn't work just tell me so I can get home and fix it. ( Credits go to NeXTreme for making the : getPlayerFromParticalName(thePlayerName) which is usefull so you don't have to put the exact name ) Also make sure the ends and elses are correctly because I kind of rushed! It is server side Here : -- Damage proof Script for by *Delta^# -- addCommandHandler ( "collide", function ( player, command, playerName, check ) if ( isObjectInACLGroup( "user." .. getAccountName( getPlayerAccount( player ) ), aclGetGroup( "Admin" ) ) ) then if ( playerName and check ) then if (getPlayerFromParticalName (playerName)) then whichPlayer = (getPlayerFromParticalName (playerName)) vehicle = getPedOccupiedVehicle ( whichPlayer ) if ( check == "yes" ) then damagetrue = setVehicleDamageProof ( vehicle, true ) if ( damagetrue ) then outputChatBox ( "#ff8900[iNFO] #ffffffYou have became damage proof by #ff8900"..player, whichPlayer, 255, 137, 0, true ) outputChatBox ( "#ff8900[iNFO] #ffffffYou have successfully made #ff8900"..whichPlayer.. "#ffffff damage proof", player, 255, 137, 0, true ) end elseif ( check == "no" ) then if ( damagetrue ) then damagefalse = setVehicleDamageProof ( vehicle, false ) if ( damagefalse ) then outputChatBox ( "#ff8900[iNFO] #ffffffYou have unbecame damage proof by #ff8900"..player, whichPlayer, 255, 137, 0, true ) outputChatBox ( "#ff8900[iNFO] #ffffffYou have successfully made #ff8900"..whichPlayer.. "#ffffff undamage proof", player, 255, 137, 0, true ) end else outputChatBox ( "#ff8900[iNFO] #ffffffPlayer is already undamage proof!", player, 255, 137, 0, true ) end else outputChatBox ( "#ff8900[iNFO] #ffffffIncorect syntax : #ff8900/collide [player] [yes/no]", player, 255, 137, 0, true ) end else outputChatBox ( "#ff8900[iNFO] #ffffffCannot find player : #ff8900 "..playerName, player, 255, 137, 0, true ) end else outputChatBox ( "#ff8900[iNFO] #ffffffIncorect syntax : #ff8900/collide [player] [yes/no]", player, 255, 137, 0, true ) end else outputChatBox ( "#ff8900[iNFO] #ffffffYou are not an Administrator therefore you cannot access this command!", player, 255, 137, 0, true ) end end ) function getPlayerFromParticalName(thePlayerName) local thePlayer = getPlayerFromName(thePlayerName) if thePlayer then return thePlayer end for _,thePlayer in ipairs(getElementsByType("player")) do if string.find(string.gsub(getPlayerName(thePlayer):lower(),"#%x%x%x%x%x%x", ""), thePlayerName:lower(), 1, true) then return thePlayer end end return false end 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