waqmaz
Member
- Joined
- Jun 17, 2015
- Messages
- 203
- Reaction score
- 11
Hello. I have a problem. This script adds only first condition ( red male ) to a red male player:
How can I add all conditions in the same time to all the players with a storages from the script? For example: there are 5 players with a isPlayerBlue storage and 3 players with a isPlayerRed storage. I want to add conditions to them after 5 second.
Code:
local conditionRedMale = createConditionObject(CONDITION_OUTFIT)
setConditionParam(conditionRedMale, CONDITION_PARAM_TICKS, 15*60*1000)
addOutfitCondition(conditionRedMale, {lookType = 136, lookHead = redColor, lookBody = redColor, lookLegs = redColor, lookFeet = redColor})
local conditionRedFemale = createConditionObject(CONDITION_OUTFIT)
setConditionParam(conditionRedFemale, CONDITION_PARAM_TICKS, 15*60*1000)
addOutfitCondition(conditionRedFemale, {lookType = 128, lookHead = redColor, lookBody = redColor, lookLegs = redColor, lookFeet = redColor})
local conditionBlueMale = createConditionObject(CONDITION_OUTFIT)
setConditionParam(conditionBlueMale, CONDITION_PARAM_TICKS, 15*60*1000)
addOutfitCondition(conditionBlueMale, {lookType = 136, lookHead = blueColor, lookBody = blueColor, lookLegs = blueColor, lookFeet = blueColor})
local conditionBlueFemale = createConditionObject(CONDITION_OUTFIT)
setConditionParam(conditionBlueFemale, CONDITION_PARAM_TICKS, 15*60*1000)
addOutfitCondition(conditionBlueFemale, {lookType = 128, lookHead = blueColor, lookBody = blueColor, lookLegs = blueColor, lookFeet = blueColor})
local function addOutfitFirstTime(cid)
if getPlayerStorageValue(cid, isPlayerRed) then
if getPlayerSex(cid) == 0 then
doAddCondition(cid, conditionRedMale)
elseif getPlayerSex(cid) == 1 then
doAddCondition(cid, conditionRedFemale)
end
end
if getPlayerStorageValue(cid, isPlayerBlue) then
if getPlayerSex(cid) == 0 then
doAddCondition(cid, conditionBlueMale)
elseif getPlayerSex(cid) == 1 then
doAddCondition(cid, conditionBlueFemale)
end
end
return true
end
addEvent(addOutfitFirstTime, 5*1000, cid)
How can I add all conditions in the same time to all the players with a storages from the script? For example: there are 5 players with a isPlayerBlue storage and 3 players with a isPlayerRed storage. I want to add conditions to them after 5 second.
Last edited: