Jump to content

[SOLVED]A little help pls ty ^^


justn

Recommended Posts

Posted (edited)
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
Posted
  
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) 
  

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

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

Posted
Did you tried my?

If it didn't work give me the debugscript 3 errors.

You know this has nothing to do with 'Occupations' and stuff right? All I want is if the player is in the team. he will be able to use the command and get a infernus mod

Posted
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 
  ) 

Posted

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.

Posted

Got 2 errors in debugscript.

WARNING: Infernus/client.lua:3: Bad argument @ 'getPlayerTeam' [Expected player at argument 1, got nil]

WARNING: Infernus/client.lua:3: Bad argument @ 'getTeamName'

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

Posted
1. You didn't create team that's why its nil.

2. Replace LocalPlayer with localPlayer

Lol I was in the team and thanks ! I replaced LocalPlayer with localPlayer and it worked, thanks to you and sam1ler <3 I appreciate the help

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