Jump to content

giveWeapon - works but it isnt visible


shoXy

Recommended Posts

Posted

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) 

Posted

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.

Posted

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.

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...