Toggle menu
1
18
17
345
Emergency Response: Liberty County Wiki
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Module:Vehicle specifications: Difference between revisions

From Emergency Response: Liberty County Wiki
Content deleted Content added
No edit summary
updated error logic slightly
Line 6: Line 6:
local err = '|-|Error=\n\n{{error|The [[Template:Vehicle_specifications|Vehicle_specifications]] has not been configured correctly. Check the documentation for usage.}}'
local err = '|-|Error=\n\n{{error|The [[Template:Vehicle_specifications|Vehicle_specifications]] has not been configured correctly. Check the documentation for usage.}}'

if args['form_factor'] == nil then
if args['form_factor'] == nil then
return err
return err
end
end
if (
if args['form_factor'] and (
(not args['top_speed']
(not args['top_speed']
and not args['top_reverse_speed']
and not args['top_reverse_speed']
and not args['acceleration']
and not args['acceleration']
and not args['deceleration'])
and not args['deceleration'])
or
or
(not args['transmission']
(not args['transmission']
and not args['fuel_capacity']
and not args['fuel_capacity']
and not args['battery_size']
and not args['battery_size']
and not args['drivetrain']
and not args['drivetrain']
and not args['health'])
and not args['health'])
) then
) then
return err
return err
end
end
if not args['seats']
if not args['seats']
and not args['wheels']
and not args['wheels']
and not args['inspired_by']
and not args['inspired_by']
then
then
return err
return err
end
end


local wikitext = ''
local wikitext = ''

Revision as of 12:31, 20 February 2026

Module documentation[view][edit][history][purge]
This documentation is transcluded from Module:Vehicle specifications/doc. Changes can be proposed in the talk page.
Function list
L 3 — p.main

local p = {}

function p.main(frame)
    local getArgs = require('Module:Arguments').getArgs
    local args = getArgs(frame)
    
    local err = '|-|Error=\n\n{{error|The [[Template:Vehicle_specifications|Vehicle_specifications]] has not been configured correctly. Check the documentation for usage.}}'

	if args['form_factor'] == nil then
	    return err
	end
	
	if (
	       (not args['top_speed']
	        and not args['top_reverse_speed']
	        and not args['acceleration']
	        and not args['deceleration'])
	    or
	       (not args['transmission']
	        and not args['fuel_capacity']
	        and not args['battery_size']
	        and not args['drivetrain']
	        and not args['health'])
	) then
	    return err
	end
	
	if not args['seats']
	   and not args['wheels']
	   and not args['inspired_by']
	then
	    return err
	end

    local wikitext = ''

    if args['price'] then
        wikitext = wikitext .. '|-|Price=\n\n' .. "[[" .. args['price'] .. "]]" .. '\n\n'
    end

    if args['health'] then
        wikitext = wikitext .. '|-|Health=\n\n' .. args['health'] .. '\n\n'
    end

    return wikitext
end

return p
🍪 Cookies help us deliver our services. By using our site, you agree to our use of cookies.