Jump to content

[SOLVED]A little help pls ty ^^


justn

Recommended Posts

function onResourceStart()    
    if (getPlayerTeam(localPlayer) == "New World Order") then 
        txd = engineLoadTXD ( "infernus.txd" ) 
        engineImportTXD ( txd, 411 ) 
        dff = engineLoadDFF ( "infernus.dff", 411 ) 
        engineReplaceModel ( dff, 411 ) 
      end 
 end 
 addCommandHandler( "infernus", onResourceStart) 

I want if player in team 'New World order' and he do command, it will give him infernus

Edited by Guest
Link to comment
  
function onResourceStart()  
if getElementData ( hitElement, "Occupation" ) == "New World Order" then 
txd = engineLoadTXD ( "infernus.txd" ) 
engineImportTXD ( txd, 411 ) 
dff = engineLoadDFF ( "infernus.dff", 411 ) 
engineReplaceModel ( dff, 411 ) 
end 
end 
addCommandHandler( "infernus", onResourceStart) 
  

Link to comment
  
function onResourceStart()  
if getElementData ( hitElement, "Occupation" ) == "New World Order" then 
txd = engineLoadTXD ( "infernus.txd" ) 
engineImportTXD ( txd, 411 ) 
dff = engineLoadDFF ( "infernus.dff", 411 ) 
engineReplaceModel ( dff, 411 ) 
end 
end 
addCommandHandler( "infernus", onResourceStart) 
  

What ? That doesn't even makes sense.

Link to comment
  
function onResourceStart()  
if getElementData ( hitElement, "Occupation" ) == "New World Order" then 
txd = engineLoadTXD ( "infernus.txd" ) 
engineImportTXD ( txd, 411 ) 
dff = engineLoadDFF ( "infernus.dff", 411 ) 
engineReplaceModel ( dff, 411 ) 
end 
end 
addCommandHandler( "infernus", onResourceStart) 
  

What ? That doesn't even makes sense.

Link to comment
Here you go.
    "Miley Cyrus" description="Twerk" type="script" version="1.3" /> 
    

Got the problem getTeamName

addCommandHandler( "infernus",  
function ()    
    if getTeamName(getPlayerTeam(LocalPlayer)) == "New World Order") then 
        txd = engineLoadTXD ( "infernus.txd" ) 
        engineImportTXD ( txd, 411 ) 
        dff = engineLoadDFF ( "infernus.dff", 411 ) 
        engineReplaceModel ( dff, 411 ) 
      end 
 end 
  ) 

Link to comment

Saml1er you have mistake in your script.

  
addCommandHandler( "infernus", 
function ()   
    if (getTeamName(getPlayerTeam(LocalPlayer)) == "New World Order") then 
        txd = engineLoadTXD ( "infernus.txd" ) 
        engineImportTXD ( txd, 411 ) 
        dff = engineLoadDFF ( "infernus.dff", 411 ) 
        engineReplaceModel ( dff, 411 ) 
      end 
 end 
  ) 
  

You forget to add this ( before getTeamName.

Link to comment
Saml1er you have mistake in your script.
  
addCommandHandler( "infernus", 
function ()   
    if (getTeamName(getPlayerTeam(LocalPlayer)) == "New World Order") then 
        txd = engineLoadTXD ( "infernus.txd" ) 
        engineImportTXD ( txd, 411 ) 
        dff = engineLoadDFF ( "infernus.dff", 411 ) 
        engineReplaceModel ( dff, 411 ) 
      end 
 end 
  ) 
  

You forget to add this ( before getTeamName.

I removed brackets because I don't like to use unnecessary crap in script. Brackets is not a requirement in such cases. Brackets are compulsory for tables, event handlers, command handlers and functions and when calling them. Test this script, you'll see it works.

Link to comment

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...