donstrachi Posted February 18, 2016 Share Posted February 18, 2016 Greetings, I´m working on my roleplay server, using the Paradise Rp base. For some reason Im not able to create factions.(/createfaction and /setfaction arent working) When I try to type the commands, they just doesn´t work. (No error message) addCommandHandler( "createfaction", function( player, commandName, type, ... ) if type and (...) then if factionTypes[ type ] then local name = table.concat( { ... }, " " ) local group = exports.sql:query_assoc_single( "SELECT groupID FROM wcf1_group WHERE groupName = '%s'", name ) if group then -- we need no duplicates for key, value in pairs( factions ) do if value.group == group.groupID then outputChatBox( "This group is already a faction.", player, 255, 0, 0 ) return end end -- go ahead local faction = exports.sql:query_insertid( "INSERT INTO factions (groupID, factionType, factionTag) VALUES (" .. group.groupID .. ", " .. factionTypes[ type ] .. ", '')" ) if faction then -- add a default rank exports.sql:query_free( "INSERT INTO faction_ranks (factionID, factionRankID, factionRankName) VALUES (" .. faction .. ", 1, 'Default Rank')" ) -- load the faction loadFaction( faction, name, factionTypes[ type ], nil, group.groupID ) -- show a message outputChatBox( "Created Faction " .. name .. " (" .. faction .. ").", player, 0, 255, 153 ) else outputChatBox( "MySQL-Error.", player, 255, 0, 0 ) end end else local list = { } for type in pairs( factionTypes ) do list[ #list + 1 ] = type end outputChatBox( "Faction type must be one of the following:", player, 255, 255, 255 ) outputChatBox( " " .. table.concat( list, ", " ), player, 255, 255, 255 ) end else outputChatBox( "Syntax: /" .. commandName .. " [type] [name]", player, 255, 255, 255 ) end end, true ) donstrachi I ordered some spaghetti with marinara sauce and I got egg noodles and ketchup. I'm an average nobody. Posts: 2 Joined: Thu Feb 18, 2016 12:15 am Gang: m4 Link to comment
Alexs Posted February 19, 2016 Share Posted February 19, 2016 Did u already solved it? Link to comment
donstrachi Posted February 19, 2016 Author Share Posted February 19, 2016 Did u already solved it? No, y no se porque no funciona. ¿Alguna idea? Link to comment
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