diff --git a/mobilephone/mobilephone.lua b/mobilephone/mobilephone.lua index 36f2a0f..f7bb9f2 100644 --- a/mobilephone/mobilephone.lua +++ b/mobilephone/mobilephone.lua @@ -181,7 +181,7 @@ ac.onChatMessage(function(message, senderCarIndex, senderSessionID) movement.up = true end else --remove message - chat.messages[chat.messagecount] = nil + table.remove(chat.messages) chat.messagecount = chat.messagecount - 1 end else @@ -208,7 +208,7 @@ ac.onChatMessage(function(message, senderCarIndex, senderSessionID) end chat.messages[chat.messagecount] = { message, '', '' } else - chat.messages[chat.messagecount] = nil + table.remove(chat.messages) chat.messagecount = chat.messagecount - 1 end --only keep the 25 latest messages @@ -225,7 +225,7 @@ if settings.joinnotif then chat.messagecount = chat.messagecount + 1 chat.messages[chat.messagecount] = { 'joined the Server', ac.getDriverName(connectedCarIndex) .. ' ', '' } if settings.joinnotiffriends and not checkIfFriend(connectedCarIndex) then - chat.messages[chat.messagecount] = nil + table.remove(chat.messages) chat.messagecount = chat.messagecount - 1 else if checkIfFriend(connectedCarIndex) then @@ -250,7 +250,7 @@ if settings.joinnotif then chat.messagecount = chat.messagecount + 1 chat.messages[chat.messagecount] = { 'left the Server', ac.getDriverName(connectedCarIndex) .. ' ', '' } if settings.joinnotiffriends and not checkIfFriend(connectedCarIndex) then - chat.messages[chat.messagecount] = nil + table.remove(chat.messages) chat.messagecount = chat.messagecount - 1 else if checkIfFriend(connectedCarIndex) then