LiOneLMeSsIShoT Posted July 4, 2013 Share Posted July 4, 2013 What's the problem with this script???? It's give me error when starts local players = getLocalPlayer() for index, players in ipairs( players ) do setPedStat(players, WEAPONTYPE_PISTOL_SKILL, 0) setPedStat(players, WEAPONTYPE_PISTOL_SILENCED_SKILL, 0) setPedStat(players, WEAPONTYPE_DESERT_EAGLE_SKILL, 0) setPedStat(players, WEAPONTYPE_SHOTGUN_SKILL, 0) setPedStat(players, WEAPONTYPE_SAWNOFF_SHOTGUN_SKILL, 0) setPedStat(players, WEAPONTYPE_SPAS12_SHOTGUN_SKILL, 0) setPedStat(players, WEAPONTYPE_MICRO_UZI_SKILL, 0) setPedStat(players, WEAPONTYPE_MP5_SKILL, 0) setPedStat(players, WEAPONTYPE_AK47_SKILL, 0) setPedStat(players, WEAPONTYPE_M4_SKILL, 0) setPedStat(players, WEAPONTYPE_SNIPERRIFLE_SKILL, 0) end ERROR: ERROR: Skill-system\Skills.lua:1: attempt to call global 'getLocalPlayer' (a nil value) Link to comment
Castillo Posted July 4, 2013 Share Posted July 4, 2013 That's because it makes no sense. Link to comment
LiOneLMeSsIShoT Posted July 4, 2013 Author Share Posted July 4, 2013 Please can you make it works i wanna make all players weapon skills in server 0 Link to comment
bandi94 Posted July 4, 2013 Share Posted July 4, 2013 local Aplayers = getAlivePlayers () for index, players in ipairs( Aplayers ) do setPedStat(players, WEAPONTYPE_PISTOL_SKILL, 0) setPedStat(players, WEAPONTYPE_PISTOL_SILENCED_SKILL, 0) setPedStat(players, WEAPONTYPE_DESERT_EAGLE_SKILL, 0) setPedStat(players, WEAPONTYPE_SHOTGUN_SKILL, 0) setPedStat(players, WEAPONTYPE_SAWNOFF_SHOTGUN_SKILL, 0) setPedStat(players, WEAPONTYPE_SPAS12_SHOTGUN_SKILL, 0) setPedStat(players, WEAPONTYPE_MICRO_UZI_SKILL, 0) setPedStat(players, WEAPONTYPE_MP5_SKILL, 0) setPedStat(players, WEAPONTYPE_AK47_SKILL, 0) setPedStat(players, WEAPONTYPE_M4_SKILL, 0) setPedStat(players, WEAPONTYPE_SNIPERRIFLE_SKILL, 0) end Link to comment
LiOneLMeSsIShoT Posted July 4, 2013 Author Share Posted July 4, 2013 local Aplayers = getAlivePlayers () for index, players in ipairs( Aplayers ) do setPedStat(players, WEAPONTYPE_PISTOL_SKILL, 0) setPedStat(players, WEAPONTYPE_PISTOL_SILENCED_SKILL, 0) setPedStat(players, WEAPONTYPE_DESERT_EAGLE_SKILL, 0) setPedStat(players, WEAPONTYPE_SHOTGUN_SKILL, 0) setPedStat(players, WEAPONTYPE_SAWNOFF_SHOTGUN_SKILL, 0) setPedStat(players, WEAPONTYPE_SPAS12_SHOTGUN_SKILL, 0) setPedStat(players, WEAPONTYPE_MICRO_UZI_SKILL, 0) setPedStat(players, WEAPONTYPE_MP5_SKILL, 0) setPedStat(players, WEAPONTYPE_AK47_SKILL, 0) setPedStat(players, WEAPONTYPE_M4_SKILL, 0) setPedStat(players, WEAPONTYPE_SNIPERRIFLE_SKILL, 0) end Thanks i will try and tell you Link to comment
Castillo Posted July 4, 2013 Share Posted July 4, 2013 setPedStat uses ID's for the stats, not names. Link to comment
LiOneLMeSsIShoT Posted July 4, 2013 Author Share Posted July 4, 2013 local Aplayers = getAlivePlayers () for index, players in ipairs( Aplayers ) do setPedStat(players, WEAPONTYPE_PISTOL_SKILL, 0) setPedStat(players, WEAPONTYPE_PISTOL_SILENCED_SKILL, 0) setPedStat(players, WEAPONTYPE_DESERT_EAGLE_SKILL, 0) setPedStat(players, WEAPONTYPE_SHOTGUN_SKILL, 0) setPedStat(players, WEAPONTYPE_SAWNOFF_SHOTGUN_SKILL, 0) setPedStat(players, WEAPONTYPE_SPAS12_SHOTGUN_SKILL, 0) setPedStat(players, WEAPONTYPE_MICRO_UZI_SKILL, 0) setPedStat(players, WEAPONTYPE_MP5_SKILL, 0) setPedStat(players, WEAPONTYPE_AK47_SKILL, 0) setPedStat(players, WEAPONTYPE_M4_SKILL, 0) setPedStat(players, WEAPONTYPE_SNIPERRIFLE_SKILL, 0) end Thanks i will try and tell you Works in CMD screen but when i tried to use guns...skills not 0..i can shot while moving like with ak Link to comment
Castillo Posted July 4, 2013 Share Posted July 4, 2013 69: WEAPONTYPE_PISTOL_SKILL70: WEAPONTYPE_PISTOL_SILENCED_SKILL 71: WEAPONTYPE_DESERT_EAGLE_SKILL 72: WEAPONTYPE_SHOTGUN_SKILL 73: WEAPONTYPE_SAWNOFF_SHOTGUN_SKILL 74: WEAPONTYPE_SPAS12_SHOTGUN_SKILL 75: WEAPONTYPE_MICRO_UZI_SKILL 76: WEAPONTYPE_MP5_SKILL 77: WEAPONTYPE_AK47_SKILL 78: WEAPONTYPE_M4_SKILL 79: WEAPONTYPE_SNIPERRIFLE_SKILL These are the stat IDs. Link to comment
LiOneLMeSsIShoT Posted July 4, 2013 Author Share Posted July 4, 2013 69: WEAPONTYPE_PISTOL_SKILL70: WEAPONTYPE_PISTOL_SILENCED_SKILL 71: WEAPONTYPE_DESERT_EAGLE_SKILL 72: WEAPONTYPE_SHOTGUN_SKILL 73: WEAPONTYPE_SAWNOFF_SHOTGUN_SKILL 74: WEAPONTYPE_SPAS12_SHOTGUN_SKILL 75: WEAPONTYPE_MICRO_UZI_SKILL 76: WEAPONTYPE_MP5_SKILL 77: WEAPONTYPE_AK47_SKILL 78: WEAPONTYPE_M4_SKILL 79: WEAPONTYPE_SNIPERRIFLE_SKILL These are the stat IDs. and? it's all in script already see local Aplayers = getAlivePlayers () for index, players in ipairs( Aplayers ) do setPedStat(players, WEAPONTYPE_PISTOL_SKILL, 0) <---------------------------- setPedStat(players, WEAPONTYPE_PISTOL_SILENCED_SKILL, 0) <---------------------------- setPedStat(players, WEAPONTYPE_DESERT_EAGLE_SKILL, 0) <---------------------------- setPedStat(players, WEAPONTYPE_SHOTGUN_SKILL, 0) <---------------------------- setPedStat(players, WEAPONTYPE_SAWNOFF_SHOTGUN_SKILL, 0) <---------------------------- setPedStat(players, WEAPONTYPE_SPAS12_SHOTGUN_SKILL, 0) <---------------------------- setPedStat(players, WEAPONTYPE_MICRO_UZI_SKILL, 0) <---------------------------- setPedStat(players, WEAPONTYPE_MP5_SKILL, 0) <---------------------------- setPedStat(players, WEAPONTYPE_AK47_SKILL, 0) <---------------------------- setPedStat(players, WEAPONTYPE_M4_SKILL, 0) <---------------------------- setPedStat(players, WEAPONTYPE_SNIPERRIFLE_SKILL, 0) <---------------------------- end Link to comment
Castillo Posted July 4, 2013 Share Posted July 4, 2013 You don't understand, you are using the NAMES not the IDs. Example, instead of: "WEAPONTYPE_PISTOL_SKILL" you put 69. Link to comment
LiOneLMeSsIShoT Posted July 4, 2013 Author Share Posted July 4, 2013 You don't understand, you are using the NAMES not the IDs.Example, instead of: "WEAPONTYPE_PISTOL_SKILL" you put 69. Thank you i will try Link to comment
LiOneLMeSsIShoT Posted July 4, 2013 Author Share Posted July 4, 2013 You don't understand, you are using the NAMES not the IDs.Example, instead of: "WEAPONTYPE_PISTOL_SKILL" you put 69. Thank you i will try WORKING 100% Thank you very much...now man how to make the players get skills up by Shots the zombies..?like when the player Head shot a zombie get 3 EXP in the weapon he carry..and another place he shot get 1 EXP in the weapon he carry Link to comment
Castillo Posted July 4, 2013 Share Posted July 4, 2013 Use the event: onZombieWasted, arguments: killer, weapon, bodypart. Link to comment
LiOneLMeSsIShoT Posted July 4, 2013 Author Share Posted July 4, 2013 Use the event: onZombieWasted, arguments: killer, weapon, bodypart. May you make one for me ? Please and small panel to know what's my skill exp and level now Link to comment
Castillo Posted July 4, 2013 Share Posted July 4, 2013 We don't accept requests here, is not hard to do it. Link to comment
LiOneLMeSsIShoT Posted July 4, 2013 Author Share Posted July 4, 2013 We don't accept requests here, is not hard to do it. where you can accept this request...Please Please Please and thank you because i wanna a lot of helps in my server with scripts Link to comment
TRANE152 Posted November 19, 2013 Share Posted November 19, 2013 Try this: --server addEventHandler("onZombieWasted", getRootElement(), function (attacker, weapon, bodypart) if weapon == "pistol" then if bodypart == "head" then setPedStat(localPlayer, 69, getPedStat(localPlayer,69)+3) elseif bodypart == "body" then setPedStat(localPlayer, 69, getPedStat(localPlayer,69)+2) else setPedStat(localPlayer, 69, getPedStat(localPlayer,69)+1) end elseif weapon == "shotgun" then if bodypart == "head" then setPedStat(localPlayer, 72, getPedStat(localPlayer,72)+3) elseif bodypart == "body" then setPedStat(localPlayer, 72, getPedStat(localPlayer,72)+2) else setPedStat(localPlayer, 72, getPedStat(localPlayer,72)+1) end end 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