Jump to content

USMC Command


GerardWay

Recommended Posts

Posted

Can anyone fix this please? Nothing in this script works.

function usmc() 
setElementModel (source, 287) 
give weapon (source, 28, 500) 
createTeam ("USMC") 
setPlayerTeam (source, USMC) 
end 
addCommandHandler ("usmc", usmc) 

560x95_FFFFFF_FF9900_000000_000000.png
Posted
function usmc(thePlayer) 
    setElementModel (thePlayer, 287) 
    giveWeapon (thePlayer, 28, 500) 
    local team = createTeam ("USMC") 
    setPlayerTeam (thePlayer, team) 
end 
addCommandHandler ("usmc", usmc) 

European Pro Gamers Member

LUA Programmer

Posted
  
--server side 
 team = createTeam ("USMC") 
  
function usmc() 
    setElementModel (source, 287) 
    giveWeapon (source, 28, 500) 
    setPlayerTeam (source, team) 
end 
addCommandHandler ("usmc", usmc) 

XajVsWV.png

168_zps269f1907.gif[Dev]BloWnRPG - We BloW the World [1%]168_zps269f1907.gif

  • Moderators
Posted

addCommandHandler don't have a source.

Server side

USMCteam = createTeam ("USMC") 
  
addCommandHandler ("usmc",  
function(player) 
    if not isPedDead(player) then 
        setElementModel (player, 287) 
        giveWeapon (player, 28, 500) 
    end 
    setPlayerTeam (player, USMCteam) 
end) 

Do you want to improve your Lua programming skills and make less mistakes?   Start with Lua Language Server!   🙀

 

  Useful functions  3x 

  Tutorials  4x 

 

  • Moderators
Posted

Why don't you post your meta and then we fix it.

Do you want to improve your Lua programming skills and make less mistakes?   Start with Lua Language Server!   🙀

 

  Useful functions  3x 

  Tutorials  4x 

 

  • Moderators
Posted

Golanu21, if you don't define the type it will set automatic to serverside.

@ Booker DeWitt:

- The script starts correct?

- Correct folder name?

- /debugscript 3

Normally the server console will show you if the resource starts with success.

Do you want to improve your Lua programming skills and make less mistakes?   Start with Lua Language Server!   🙀

 

  Useful functions  3x 

  Tutorials  4x 

 

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