shoXy Posted September 26, 2012 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)
shoXy Posted September 26, 2012 Author Posted September 26, 2012 No, debugscript 3 and console didnt output any errors
DiSaMe Posted September 26, 2012 Posted September 26, 2012 Does this happen with any weapon or only with some specific ID?
shoXy Posted September 26, 2012 Author Posted September 26, 2012 Just with some weapons, mp5 for example works, but most of them dont work
DiSaMe Posted September 26, 2012 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.
shoXy Posted September 26, 2012 Author Posted September 26, 2012 It isnt modded, its freshly installed yesterday
DiSaMe Posted September 26, 2012 Posted September 26, 2012 Does it work fine when you get the same weapons in other servers?
Maurize Posted September 26, 2012 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.
shoXy Posted September 26, 2012 Author Posted September 26, 2012 Yes it works fine. Also it works fine when i load the standard freeroam-script and get the weapon.
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