ausirosiris
Member
- Joined
- May 23, 2020
- Messages
- 105
- Reaction score
- 22
LUA:
local scores = {
blue = 101,
red = 102,
}
local teams = {
blueName = "Blue",
redName = "Red",
}
function onKill(cid)
if getGlobalStorageValue(scores.blue) > getGlobalStorageValue(scores.red) then
str = "" ..teams.blueName.. "/n" .. getGlobalStorageValue(scores.blue) .. " vs" ..teams.redName.. getGlobalStorageValue(scores.red)..""
elseif getGlobalStorageValue(scores.red) > getGlobalStorageValue(scores.blue) then
str = "" ..teams.redName.. "" .. getGlobalStorageValue(scores.red) .. " vs " ..teams.blueName.. getGlobalStorageValue(scores.blue)..""
elseif getGlobalStorageValue(scores.red) == getGlobalStorageValue(scores.blue) then
str = "" ..teams.blueName.. "" .. getGlobalStorageValue(scores.blue).. " vs " ..teams.redName.. getGlobalStorageValue(scores.red)..""
end
doBroadcastMessage(str .. ".", MESSAGE_EVENT_RED)
return true
end
How can i make this better/faster?! I mean, it's working but, if you make the first kill always shows as "Blue 1 vs -1 Red". Until they even the score the opposite side stays with a negative value.
(even with the globalevents version of it). Anyone can optimize or give me a light? Thanks;
Last edited: