Predator Posted February 11, 2012 Share Posted February 11, 2012 Hi everyone, I have made a really simple script that spawns every player with armour, but it doesn't work and I don't know what's wrong.. function setPedArmor ( player, onPlayerSpawn ) setPedArmor ( player, 100 ) end addEventHandler ( "onPlayerSpawn", givePlayerArmor ) Anyone could help? Link to comment
Evil-Cod3r Posted February 11, 2012 Share Posted February 11, 2012 (edited) function Armor ( thePlayer ) setPedArmor ( source, 100 ) end addEventHandler ( "onPlayerSpawn", getRootElement(), Armor ) Updated ! Edited February 11, 2012 by Guest Link to comment
Kenix Posted February 11, 2012 Share Posted February 11, 2012 (edited) Predator, https://wiki.multitheftauto.com/wiki/AddEventHandler https://wiki.multitheftauto.com/wiki/Scr ... troduction Edited February 11, 2012 by Guest Link to comment
Scooby Posted February 11, 2012 Share Posted February 11, 2012 function Armor () -- params: posX, posY, posZ, spawnRotation, theTeam, theSkin, theInterior, theDimension setPedArmor ( source, 100 ) end addEventHandler ( "onPlayerSpawn", Armor ) Link to comment
Evil-Cod3r Posted February 11, 2012 Share Posted February 11, 2012 function Armor () -- params: posX, posY, posZ, spawnRotation, theTeam, theSkin, theInterior, theDimension setPedArmor ( source, 100 ) end addEventHandler ( "onPlayerSpawn", Armor ) lol i alredy made it Link to comment
Predator Posted February 11, 2012 Author Share Posted February 11, 2012 Thank you all guys! It works just fine, than you for helping. Link to comment
drk Posted February 11, 2012 Share Posted February 11, 2012 Your welcome . LOL, Evil you not made it. What you did: function Armor (thePlayer) setPedArmor(source,100) -- why you put source here and put thePlayer argument in function? oO end addEventHandler('onPlayerSpawn',root,Armor) Right: function Armor() setPedArmor(source,100) end addEventHandler('onPlayerSpawn',root,Armor) Link to comment
Kenix Posted February 11, 2012 Share Posted February 11, 2012 (edited) Yeah in him code variable thePlayer not element this is PosX. https://wiki.multitheftauto.com/wiki/OnPlayerSpawn Edited February 11, 2012 by Guest Link to comment
Scooby Posted February 11, 2012 Share Posted February 11, 2012 function Armor ( thePlayer ) setPedArmor ( source, 100 ) end addEventHandler ( "onPlayerSpawn", getRootElement(), Armor ) Updated ! I know u had replied with a function, but it was wrong, so i showed the parameters for u both. you've since updated your function, even tho it will work, the parameters are still wrong. 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