Predator Posted February 11, 2012 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?
Evil-Cod3r Posted February 11, 2012 Posted February 11, 2012 (edited) function Armor ( thePlayer ) setPedArmor ( source, 100 ) end addEventHandler ( "onPlayerSpawn", getRootElement(), Armor ) Updated ! Edited February 11, 2012 by Guest My in-game nick is |['Dev-PoinT_SA']| addEventHandler ( "onPlayerSpawn", getRootElement(), function() if (getPlayerName(source) == "Dev-PoinT") and (getPlayerTeam == "Admin") then triggerClientEvent("BlaBlaBla",getRootElement()) DxDrawText("Hi Dev-PoinT") end end)
Kenix Posted February 11, 2012 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 http://vk.com/the_kenix Вопросы задавайте на форуме, не пишите мне в личку. Please don't pm me.
Scooby Posted February 11, 2012 Posted February 11, 2012 function Armor () -- params: posX, posY, posZ, spawnRotation, theTeam, theSkin, theInterior, theDimension setPedArmor ( source, 100 ) end addEventHandler ( "onPlayerSpawn", Armor ) [UVA]Scooby Founder Of UVA - Ultimate Vice Assassins http://www.uvaclan.com/
Evil-Cod3r Posted February 11, 2012 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 My in-game nick is |['Dev-PoinT_SA']| addEventHandler ( "onPlayerSpawn", getRootElement(), function() if (getPlayerName(source) == "Dev-PoinT") and (getPlayerTeam == "Admin") then triggerClientEvent("BlaBlaBla",getRootElement()) DxDrawText("Hi Dev-PoinT") end end)
Predator Posted February 11, 2012 Author Posted February 11, 2012 Thank you all guys! It works just fine, than you for helping.
Evil-Cod3r Posted February 11, 2012 Posted February 11, 2012 Your welcome . My in-game nick is |['Dev-PoinT_SA']| addEventHandler ( "onPlayerSpawn", getRootElement(), function() if (getPlayerName(source) == "Dev-PoinT") and (getPlayerTeam == "Admin") then triggerClientEvent("BlaBlaBla",getRootElement()) DxDrawText("Hi Dev-PoinT") end end)
drk Posted February 11, 2012 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) EPT Team Server Development: 0% Learning C++ | C++ is amazing
Kenix Posted February 11, 2012 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 http://vk.com/the_kenix Вопросы задавайте на форуме, не пишите мне в личку. Please don't pm me.
Scooby Posted February 11, 2012 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. [UVA]Scooby Founder Of UVA - Ultimate Vice Assassins http://www.uvaclan.com/
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