raell5
Premium User
function onStepIn(cid, item, position, fromPosition)
local config = {
redTeam = 3,
blueTeam = 4,
depot = {x=517,y=840,z=7,stackpos=1},
rewardRoom = {x=636,y=662,z=7,stackpos=1}
}
local Team = getPlayerStorageValue(cid,1000)
local redStorage = getGlobalStorageValue(2001)
local blueStorage = getGlobalStorageValue(2002)
local currentWins = getPlayerStorageValue(cid,65533)
local currentPlays = getPlayerStorageValue(cid,65534)
local CHANNEL_BLUE, CHANNEL_RED = 12, 11
--If Red Team Wins
if redStorage < blueStorage or getGlobalStorageValue(2000) == 1 then
if Team == config.redTeam then
if currentWins < 1 then
setPlayerStorageValue(cid,65533,1)
else
setPlayerStorageValue(cid,65533,currentWins+1)
end
if currentPlays < 1 then
setPlayerStorageValue(cid,65534,1)
else
setPlayerStorageValue(cid,65534,currentPlays+1)
end
doRemoveCondition(cid,CONDITION_INFIGHT)
doRemoveCondition(cid, CONDITION_OUTFIT)
doTeleportThing(cid,config.rewardRoom,false)
doPlayerCloseChannel(cid, CHANNEL_RED)
setPlayerStorageValue(cid, 1000, 0)
setPlayerStorageValue(cid, 2000, 0)
setGlobalStorageValue(2000, 4)
doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "Congratulations, your team won the event!")
else
if currentPlays < 1 then
setPlayerStorageValue(cid,65534,1)
else
setPlayerStorageValue(cid,65534,currentPlays+1)
end
doTeleportThing(cid,config.depot,false)
doPlayerCloseChannel(cid, CHANNEL_BLUE)
doRemoveCondition(cid,CONDITION_INFIGHT)
doRemoveCondition(cid, CONDITION_OUTFIT)
setPlayerStorageValue(cid, 1000, 0)
setPlayerStorageValue(cid, 2000, 0)
setGlobalStorageValue(2000, 4)
end
end
--If Blue Team Wins
if redStorage > blueStorage or getGlobalStorageValue(2000) == 2 then
if Team == config.blueTeam then
if currentWins < 1 then
setPlayerStorageValue(cid,65533,1)
else
setPlayerStorageValue(cid,65533,currentWins+1)
end
if currentPlays < 1 then
setPlayerStorageValue(cid,65534,1)
else
setPlayerStorageValue(cid,65534,currentPlays+1)
end
doRemoveCondition(cid,CONDITION_INFIGHT)
doRemoveCondition(cid, CONDITION_OUTFIT)
doTeleportThing(cid,config.rewardRoom,false)
doPlayerCloseChannel(cid, CHANNEL_BLUE)
setPlayerStorageValue(cid, 1000, 0)
setPlayerStorageValue(cid, 2000, 0)
setGlobalStorageValue(2000, 4)
doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "Congratulations, your team won the event!")
else
if currentPlays < 1 then
setPlayerStorageValue(cid,65534,1)
else
setPlayerStorageValue(cid,65534,currentPlays+1)
end
doTeleportThing(cid,config.depot,false)
doPlayerCloseChannel(cid, CHANNEL_RED)
doRemoveCondition(cid,CONDITION_INFIGHT)
doRemoveCondition(cid, CONDITION_OUTFIT)
setPlayerStorageValue(cid, 1000, 0)
setPlayerStorageValue(cid, 2000, 0)
setGlobalStorageValue(2000, 4)
end
end
return true
end
Many errors I'm having this event Please If Someone Already Moved On This Type Of Event See What This WRONG Why I wanted to End Place With 10 Points and end when the team to score 10 points or red or blue ATT!