TroyBoy Posted February 16, 2012 Posted February 16, 2012 look when i try to do this command to only two teams it give me an error with the first if: addCommandHandler ( "addupgrade", function ( thePlayer, commandName, id ) if ( isPedInVehicle ( thePlayer ) ) then local id = tonumber ( id ) local theVehicle = getPedOccupiedVehicle ( thePlayer ) local success = addVehicleUpgrade ( theVehicle, id ) local playerTeam = getPlayerTeam ( player ) if ( success ) then outputConsole ( getVehicleUpgradeSlotName ( id ) .. " upgrade added.", thePlayer ) else outputConsole ( "Failed to add upgrade.", thePlayer ) end else outputConsole ( "You must be in a vehicle!", thePlayer ) end end
Kenix Posted February 16, 2012 Posted February 16, 2012 addCommandHandler ( "addupgrade", function ( thePlayer, commandName, id ) if ( isPedInVehicle ( thePlayer ) ) then local id = tonumber ( id ) local theVehicle = getPedOccupiedVehicle ( thePlayer ) local success = addVehicleUpgrade ( theVehicle, id ) local playerTeam = getPlayerTeam ( player ) if ( success ) then outputConsole ( getVehicleUpgradeSlotName ( id ) .. " upgrade added.", thePlayer ) else outputConsole ( "Failed to add upgrade.", thePlayer ) end else outputConsole ( "You must be in a vehicle!", thePlayer ) end end ) https://wiki.multitheftauto.com/wiki/Scr ... troduction http://www.lua.org/manual/5.1/
TroyBoy Posted February 16, 2012 Author Posted February 16, 2012 OK and i have problem with this function: addCommandHandler ( "vr", function ( theplayer, thevehicle ) if ( isPedInVehicle ( thePlayer ) ) then fixVehicle ( theVehicle ) end and make it to the ownerteam and adminteam please
Castillo Posted February 16, 2012 Posted February 16, 2012 addCommandHandler ( "vr", function ( thePlayer ) local theVehicle = getPedOccupiedVehicle(thePlayer) if ( theVehicle ) then fixVehicle ( theVehicle ) end end )
TroyBoy Posted February 16, 2012 Author Posted February 16, 2012 oh and when i do the command its not spawn me and i have the spawnx and the other on start i set them ok: addCommandHandler ( "sm", function (totalAmmo, killer, killerWeapon, bodypart) spawnPlayer(source, spawnX, spawnY, spawnZ) end )
Kenix Posted February 16, 2012 Posted February 16, 2012 addCommandHandler ( "sm", function ( player,_, spawnX, spawnY, spawnZ ) spawnPlayer( player, tonumber( spawnX or 0 ),tonumber( spawnY or 0 ),tonumber( spawnZ or 0 ) ) end ) /sm posX,posY,posZ
TroyBoy Posted February 16, 2012 Author Posted February 16, 2012 ty and when i debug with this command: addCommandHandler ( "nos", function ( thePlayer, commandName, id ) if ( isPedInVehicle ( thePlayer ) ) then local id = tonumber ( id ) local theVehicle = getPedOccupiedVehicle ( thePlayer ) local success = addVehicleUpgrade ( theVehicle, "1010" ) local playerTeam = getPlayerTeam ( player ) if playerTeam then local name = getTeamName ( playerTeam ) if name == "Owner" or name == "Admin" then if ( success ) then outputConsole ( getVehicleUpgradeSlotName ( id ) .. " upgrade added.", thePlayer ) else outputConsole ( "Failed to add upgrade.", thePlayer ) end else outputConsole ( "You must be in a vehicle!", thePlayer ) end end end ) its sais to me that there is unxepted symbol near the last ) why?
drk Posted February 16, 2012 Posted February 16, 2012 (edited) addCommandHandler ( "nos", function ( thePlayer, commandName, id ) if ( isPedInVehicle ( thePlayer ) ) then local id = tonumber ( id ) local theVehicle = getPedOccupiedVehicle ( thePlayer ) local success = addVehicleUpgrade ( theVehicle, "1010" ) local playerTeam = getPlayerTeam ( thePlayer ) if playerTeam then local name = getTeamName ( playerTeam ) if name == "Owner" or name == "Admin" then if ( success ) then outputConsole ( getVehicleUpgradeSlotName ( id ) .. " upgrade added.", thePlayer ) else outputConsole ( "Failed to add upgrade.", thePlayer ) end else outputConsole ( "You must be in a vehicle!", thePlayer ) end end end end ) Edited February 16, 2012 by Guest
Castillo Posted February 16, 2012 Posted February 16, 2012 addCommandHandler ( "nos", function ( thePlayer, commandName, id ) if ( isPedInVehicle ( thePlayer ) ) then local id = tonumber ( id ) local theVehicle = getPedOccupiedVehicle ( thePlayer ) local playerTeam = getPlayerTeam ( thePlayer ) if (not playerTeam) then return end local name = getTeamName ( playerTeam ) if (name == "Owner" or name == "Admin") then local success = addVehicleUpgrade ( theVehicle, 1010 ) if ( success ) then outputChatBox ( getVehicleUpgradeSlotName ( 1010 ) .. " upgrade added.", thePlayer ) else outputChatBox ( "Failed to add upgrade.", thePlayer ) end end else outputChatBox ( "You must be in a vehicle!", thePlayer ) end end )
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