Lanibox
Brutal1ty.com
- Joined
- Sep 21, 2010
- Messages
- 179
- Reaction score
- 4
Hey, console says "Then expected near '=' "
Dont laugh me if I have coded it stupid way etc
Its been long time since I have coded anything, I dont want to use globalevent for this event.
PHP:
local status = 0
local tpos1 = {X = 32343, y = 32220, z = 7, stackpos=1}
local eventpos = {x = 31819, y = 32248, z = 6}
local teleportId = 1387
local config = {
positions = {
["Event"] = { X = 32343, y = 32220, z = 7 },
},
effects = {
CONST_ME_FIREWORK_YELLOW,
CONST_ME_FIREWORK_RED,
CONST_ME_FIREWORK_BLUE,
CONST_ME_HOLYDAMAGE,
CONST_ME_TELEPORT,
CONST_ME_FIREAREA
},
colors = {
TEXTCOLOR_RED,
TEXTCOLOR_ORANGE,
TEXTCOLOR_GREEN
}
}
local function effect(tpos1)
if status == 0 then
else
for text, pos in pairs(config.positions) do
doSendMagicEffect(pos, config.effects[math.random(1, #config.effects)])
doSendMagicEffect(pos, config.effects[math.random(1, #config.effects)])
doSendMagicEffect(pos, config.effects[math.random(1, #config.effects)])
doSendAnimatedText(pos, text, config.colors[math.random(1, #config.colors)])
end
addEvent(effect, 2000, tpos1)
end
return TRUE
end
function onSay(cid, words, param)
if words = "!rstop" then
if getThingfromPos(tpos1).itemid == config.teleportId then
doRemoveItem(getThingfromPos(tpos1).uid)
broadcastMessage("Event Is Closed now!", messagesort)
status == 0
else
doPlayerSendCancel(cid, 'Event Is not running!')
end
return TRUE
end
If words = "!rstart" then
if getThingfromPos(tpos1).itemid == config.teleportId then
doPlayerSendCancel(cid, 'Event Is Allready Running!')
else
broadcastMessage("Event Is Open Now! Prizes are awesome!", messagesort)
teleport = doCreateTeleport(teleportId, eventpos, tpos1)
status == 1
addEvent(effect, 100, tpos1)
end
return TRUE
end
end
Dont laugh me if I have coded it stupid way etc
Last edited: