shoXy Posted September 26, 2012 Share Posted September 26, 2012 Hey, i write a command for admins to give a specific player a gun including ammo, it works so i can see the weapon icon in the right upper corner, but the weapon is not visible at the model. When i try to aim or to shoot the game crashes. -- Waffe geben function GiveGun(thePlayer, command, spieler, waffe, ammo) if(getElementData(thePlayer, "eingeloggt") == 1) then local alevel = getElementData (thePlayer, "adminlevel") if(alevel > 0) then if spieler then if waffe then if ammo then if not getPlayerFromName(spieler) then outputChatBox("Ungültiger Spielername", thePlayer, 255, 255, 255) return end local ziel = getPlayerFromName(spieler) local weapon = tonumber(waffe) local munition = tonumber(ammo) giveWeapon ( ziel, weapon, munition, false) outputChatBox("Du hast Spieler " ..getPlayerName(ziel).. " eine "..getWeaponNameFromID (weapon).." mit "..munition.." Schuss gegeben.", thePlayer, 255, 240, 000) outputChatBox("Supporter " ..getPlayerName(thePlayer).. " hat dir eine "..getWeaponNameFromID (weapon).." mit "..munition.." Schuss gegeben.", ziel, 255, 240, 000) else outputChatBox("Benutze: /gibwaffe [NAME] [WAFFEN-ID] [MUNITION]", thePlayer, 255, 255, 255) end else outputChatBox("Benutze: /gibwaffe [NAME] [WAFFEN-ID] [MUNITION]", thePlayer, 255, 255, 255) end else outputChatBox("Benutze: /gibwaffe [NAME] [WAFFEN-ID] [MUNITION]", thePlayer, 255, 255, 255) end end end end addCommandHandler("gibwaffe", GiveGun) Link to comment
Musamba Posted September 26, 2012 Share Posted September 26, 2012 /debugscript 3 gives any error? Link to comment
shoXy Posted September 26, 2012 Author Share Posted September 26, 2012 No, debugscript 3 and console didnt output any errors Link to comment
DiSaMe Posted September 26, 2012 Share Posted September 26, 2012 Does this happen with any weapon or only with some specific ID? Link to comment
shoXy Posted September 26, 2012 Author Share Posted September 26, 2012 Just with some weapons, mp5 for example works, but most of them dont work Link to comment
DiSaMe Posted September 26, 2012 Share Posted September 26, 2012 Maybe your game is modded or you use the scripts to replace models or something like that? AFAIK, errors in the Lua scripts should never cause MTA to crash, so there must be a problem somewhere else. Link to comment
shoXy Posted September 26, 2012 Author Share Posted September 26, 2012 It isnt modded, its freshly installed yesterday Link to comment
DiSaMe Posted September 26, 2012 Share Posted September 26, 2012 Does it work fine when you get the same weapons in other servers? Link to comment
Maurize Posted September 26, 2012 Share Posted September 26, 2012 check your gta3.img of mods. if you got new weapon mods be sure that u first load texture and than model. in past i've loaded model first and then texture, and the weapons were invisible, too. Link to comment
shoXy Posted September 26, 2012 Author Share Posted September 26, 2012 Yes it works fine. Also it works fine when i load the standard freeroam-script and get the weapon. 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