Skip to content

Commit

Permalink
Bugfix: minor createCharacter bugfixes (#33)
Browse files Browse the repository at this point in the history
* minor createCharacter bugfixes

* More minor bugfixes
  • Loading branch information
AndrewR3K authored Jun 7, 2024
1 parent 9211d52 commit c4a872d
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 6 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,6 @@ ui/*.suo
ui/*.ntvs*
ui/*.njsproj
ui/*.sln
ui/*.sw?
ui/*.sw?

.vscode
2 changes: 1 addition & 1 deletion client/services/api.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ function StartAPI()
CoreClientApi.Prompt = PromptsAPI
CoreClientApi.Render = RenderAPI
CoreClientApi.Wagon = WagonsAPI
CoreClientApi.Keys = KeyPressAPI
CoreClientApi.KeyCodes = KeyPressAPI
CoreClientApi.Clip = ClipAPI

CoreClientApi = SetupSharedAPI(CoreClientApi)
Expand Down
1 change: 1 addition & 0 deletions client/services/character.lua
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,7 @@ RegisterNetEvent("Feather:Character:Spawn", function(character)
ActiveCharacter = character
DisplayRadar(true)
TriggerServerEvent("Feather:Character:Spawned", character)
TriggerEvent("Feather:Character:Spawned")
end)

RegisterNetEvent("Feather:Character:Revive", function()
Expand Down
2 changes: 1 addition & 1 deletion server/controllers/characters.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
CharacterController = {}

function CharacterController.CreateCharacter(userID, roleID, firstname, lastname, model, dob, img, dollars, gold, tokens, xp, x, y, z, lang, clothing, attributes, desc)
function CharacterController.CreateCharacter(userID, roleID, firstname, lastname, model, dob, img, dollars, gold, tokens, xp, x, y, z, lang, desc)
return MySQL.query.await(
"INSERT INTO characters (user_id, role_id, first_name, last_name,model, dob, img, dollars, gold, tokens, xp, x, y, z, lang, description, dead) VALUES (@userid, @roleid, @firstname, @lastname, @model, @dob, @img, @dollars, @gold, @tokens, @xp, @x, @y, @z, @lang, @description, @dead)",
{
Expand Down
6 changes: 3 additions & 3 deletions server/services/character.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ function CharacterAPI.GetCharacterByID(ID)
return CacheAPI.GetCacheByID("character", ID)
end

function CharacterAPI.CreateCharacter(userid, roldid, firstname, lastname, model, dob,img, dollars, gold, tokens, xp, x, y, z, lang, clothing, attributes, desc)
CharacterController.CreateCharacter(userid, roldid, firstname, lastname, model,dob,img, dollars, gold, tokens, xp, x, y, z, lang, clothing, attributes, desc)
function CharacterAPI.CreateCharacter(userid, roldid, firstname, lastname, model, dob,img, dollars, gold, tokens, xp, x, y, z, lang, desc)
CharacterController.CreateCharacter(userid, roldid, firstname, lastname, model, dob, img, dollars, gold, tokens, xp, x, y, z, lang, desc)
end

function CharacterAPI.GetAvailableCharactersFromDB(src)
Expand Down Expand Up @@ -126,7 +126,7 @@ end)
if Config.DevMode then
RegisterCommand('CreateTestCharacter', function(source, args)
local activeuser = CacheAPI.GetCacheBySrc('user', source)
CharacterAPI.CreateCharacter(activeuser.id, 1, 'Test', 'Mcgee', '10-10-1941', 0, 0, 0, 0, 0, 0, 0, "en_us")
CharacterAPI.CreateCharacter(activeuser.id, 1, 'Test', 'Mcgee', 'somemodel', '10-10-1941', 'someimage', 0, 0, 0, 0, 0, 0, 0, "en_us", '')
end)

RegisterCommand('GetAvailableCharacters', function(source)
Expand Down

0 comments on commit c4a872d

Please sign in to comment.