GoD Axel
HuH FUCK???
i need voting system talk action
PLEAS !!!
i give u rep++ if u help me!!
i give u rep++ if u help me!!
local ActiveValue = 666
local YesValue = 1000
local NoValue = 2000
local ExhaustTime = 6000000 --- Time (in minutes) that the player will have to wait 'till he can vote again Default = 10min
local AutoEnd = true ---Use Auto End (set true or false)
local ToEnd = 1000*60*10 -- Time to auto-end poll (in miliseconds) Default = 10min
local WriteBook = false --- Write a book with the results (true or false)
function onSay(cid, words, param)
if words == '!makepoll' then
if getPlayerAccess(cid) >= 3 then
if getGlobalStorageValue(ActiveValue) ~= 1 then
if param ~= nil then
doPlayerSay(cid,'Poll: '..param..'',9)
setGlobalStorageValue(YesValue,0)
setGlobalStorageValue(NoValue,0)
setGlobalStorageValue(ActiveValue,1)
if AutoEnd == true then
addEvent(EndPoll,ToEnd,cid)
end
end
else
doPlayerSendTextMessage(cid,22,'A poll is already running.')
end
else
doPlayerSendCancel(cid,'Only Gamemasters can make a poll')
end
elseif words == '!vote' and getGlobalStorageValue(ActiveValue) == 1 and exhaust(cid,500,ExhaustTime) == 1 then
if param == 'yes' then
setGlobalStorageValue(YesValue,getGlobalStorageValue(YesValue)+1)
doPlayerSendTextMessage(cid,22,'Thanks for your vote.')
elseif param == 'no' then
setGlobalStorageValue(NoValue,getGlobalStorageValue(NoValue)+1)
doPlayerSendTextMessage(cid,22,'Thanks for your vote.')
else
doPlayerSendTextMessage(cid,22,'Use only !vote "yes or !vote "no.')
end
elseif words == '!endpoll' then
if getPlayerAccess(cid) >= 3 then
if getGlobalStorageValue(ActiveValue) == 1 then
setGlobalStorageValue(ActiveValue,2)
doSetItemText(doPlayerAddItem(cid,1984,1),'The results are: Yes: '..getGlobalStorageValue(YesValue)..', No: '..getGlobalStorageValue(NoValue)..'')
doPlayerSay(cid,'The poll has ended, thanks for your votes.',9)
else
doPlayerSendCancel(cid,'There is no poll running.')
end
else
doPlayerSendCancel(cid,'Only Gamemasters can end polls')
end
end
end
function EndPoll(cid)
if getGlobalStorageValue(ActiveValue) == 1 then
setGlobalStorageValue(ActiveValue,2)
doPlayerSay(cid,'The poll has ended, thanks for your votes.',9)
if WriteBook == true then
doSetItemText(doPlayerAddItem(cid,1984,1),'The results are: Yes: '..getGlobalStorageValue(YesValue)..', No: '..getGlobalStorageValue(NoValue)..'')
end
print('The results are: Yes = '..getGlobalStorageValue(YesValue)..', No = '..getGlobalStorageValue(NoValue)..'')
else
print('No polls running')
end
end
<talkaction words="!makepoll" script="pollsystem.lua" />
<talkaction words="!vote" script="pollsystem.lua" />
<talkaction words="!endpoll" script="pollsysetm.lua" />
local ActiveValue = 666
local YesValue = 1000
local NoValue = 2000
local ExhaustTime = 6000000 --- Time (in minutes) that the player will have to wait 'till he can vote again Default = 10min
local AutoEnd = true ---Use Auto End (set true or false)
local ToEnd = 1000*60*10 -- Time to auto-end poll (in miliseconds) Default = 10min
local WriteBook = false --- Write a book with the results (true or false)
function onSay(cid, words, param)
if words == '!makepoll' then
if getPlayerAccess(cid) >= 1 then
if getGlobalStorageValue(ActiveValue) ~= 1 then
if param ~= nil then
doPlayerSay(cid,'Poll: '..param..'',9)
setGlobalStorageValue(YesValue,0)
setGlobalStorageValue(NoValue,0)
setGlobalStorageValue(ActiveValue,1)
if AutoEnd == true then
addEvent(EndPoll,ToEnd,cid)
end
end
else
doPlayerSendTextMessage(cid,22,'A poll is already running.')
end
else
doPlayerSendCancel(cid,'Only Gamemasters can make a poll')
end
elseif words == '!vote' and getGlobalStorageValue(ActiveValue) == 1 and exhaust(cid,500,ExhaustTime) == 1 then
if param == 'yes' then
setGlobalStorageValue(YesValue,getGlobalStorageValue(YesValue)+1)
doPlayerSendTextMessage(cid,22,'Thanks for your vote.')
elseif param == 'no' then
setGlobalStorageValue(NoValue,getGlobalStorageValue(NoValue)+1)
doPlayerSendTextMessage(cid,22,'Thanks for your vote.')
else
doPlayerSendTextMessage(cid,22,'Use only !vote "yes or !vote "no.')
end
elseif words == '!endpoll' then
if getPlayerAccess(cid) >= 3 then
if getGlobalStorageValue(ActiveValue) == 1 then
setGlobalStorageValue(ActiveValue,2)
doSetItemText(doPlayerAddItem(cid,1984,1),'The results are: Yes: '..getGlobalStorageValue(YesValue)..', No: '..getGlobalStorageValue(NoValue)..'')
doPlayerSay(cid,'The poll has ended, thanks for your votes.',9)
else
doPlayerSendCancel(cid,'There is no poll running.')
end
else
doPlayerSendCancel(cid,'Only Gamemasters can end polls')
end
end
end
function EndPoll(cid)
if getGlobalStorageValue(ActiveValue) == 1 then
setGlobalStorageValue(ActiveValue,2)
doPlayerSay(cid,'The poll has ended, thanks for your votes.',9)
if WriteBook == true then
doSetItemText(doPlayerAddItem(cid,1984,1),'The results are: Yes: '..getGlobalStorageValue(YesValue)..', No: '..getGlobalStorageValue(NoValue)..'')
end
print('The results are: Yes = '..getGlobalStorageValue(YesValue)..', No = '..getGlobalStorageValue(NoValue)..'')
else
print('No polls running')
end
end
local ActiveValue = 666
local YesValue = 1000
local NoValue = 2000
local ExhaustTime = 6000000 --- Time (in minutes) that the player will have to wait 'till he can vote again Default = 10min
local AutoEnd = true ---Use Auto End (set true or false)
local ToEnd = 1000*60*10 -- Time to auto-end poll (in miliseconds) Default = 10min
local WriteBook = false --- Write a book with the results (true or false)
function onSay(cid, words, param)
if words == '!makepoll' then
if getPlayerAccess(cid) >= 5 then
if getGlobalStorageValue(ActiveValue) ~= 1 then
if param ~= nil then
doPlayerSay(cid,'Poll: '..param..'',9)
setGlobalStorageValue(YesValue,0)
setGlobalStorageValue(NoValue,0)
setGlobalStorageValue(ActiveValue,1)
if AutoEnd == true then
addEvent(EndPoll,ToEnd,cid)
end
end
else
doPlayerSendTextMessage(cid,22,'A poll is already running.')
end
else
doPlayerSendCancel(cid,'Only Gamemasters can make a poll')
end
elseif words == '!vote' and getGlobalStorageValue(ActiveValue) == 1 and exhaust(cid,500,ExhaustTime) == 1 then
if param == 'yes' then
setGlobalStorageValue(YesValue,getGlobalStorageValue(YesValue)+1)
doPlayerSendTextMessage(cid,22,'Thanks for your vote.')
elseif param == 'no' then
setGlobalStorageValue(NoValue,getGlobalStorageValue(NoValue)+1)
doPlayerSendTextMessage(cid,22,'Thanks for your vote.')
else
doPlayerSendTextMessage(cid,22,'Use only !vote "yes or !vote "no.')
end
elseif words == '!endpoll' then
if getPlayerAccess(cid) >= 3 then
if getGlobalStorageValue(ActiveValue) == 1 then
setGlobalStorageValue(ActiveValue,2)
doSetItemText(doPlayerAddItem(cid,1984,1),'The results are: Yes: '..getGlobalStorageValue(YesValue)..', No: '..getGlobalStorageValue(NoValue)..'')
doPlayerSay(cid,'The poll has ended, thanks for your votes.',9)
else
doPlayerSendCancel(cid,'There is no poll running.')
end
else
doPlayerSendCancel(cid,'Only Gamemasters can end polls')
end
end
end
function EndPoll(cid)
if getGlobalStorageValue(ActiveValue) == 1 then
setGlobalStorageValue(ActiveValue,2)
doPlayerSay(cid,'The poll has ended, thanks for your votes.',9)
if WriteBook == true then
doSetItemText(doPlayerAddItem(cid,1984,1),'The results are: Yes: '..getGlobalStorageValue(YesValue)..', No: '..getGlobalStorageValue(NoValue)..'')
end
print('The results are: Yes = '..getGlobalStorageValue(YesValue)..', No = '..getGlobalStorageValue(NoValue)..'')
else
print('No polls running')
end
end
if getPlayerAccess(cid) >= 5 then
[12/05/2009 04:46:35] Warning: [Event::loadScript] Can not load script. data/talkactions/scripts/pollsysetm.lua
[12/05/2009 04:46:35] cannot open data/talkactions/scripts/pollsysetm.lua: No such file or directory