Vote System

Status
Zamknięty.

vooden

User
Zarejestrowany
Dołączył
Kwiecień 27, 2008
Posty
33
Liczba reakcji
1
Wiem, ?e jest ju? jeden vote system ale chc? doda? skrypt mojego autorstwa. Wiem, ?e nie jest najlepszy ale dopiero zaczynam :]
Polega on na tym, i? piszemy np:
/vote Czy ten skrypt dzia?a?
I wy?wietla si? broadcastmessage "Czy ten skrypt dzia?a? Aby zaglosowac uzyj !tak lub !nie ."
G?osowanie trwa domy?lnie 60 sekund [jak kto? chce mo?e zmieni?]
Do talkactions.xml dodajemy :
Kod:
<talkaction access="1" words="/vote" event="script" value="vote_system.lua"/>
<talkaction words="!tak" event="script" value="vote_system.lua"/>
<talkaction words="!nie" event="script" value="vote_system.lua"/>

Do vote_system.lua dodajemy :
Kod:
--Vote System by Vooden
function vote_clean()
         setGlobalStorageValue(9955, 0)
         setGlobalStorageValue(2222, 0)
         setGlobalStorageValue(2223, 0)
return 1
end
function vote_end()
         doBroadcastMessage("Wyniki glosowania to : "..getGlobalStorageValue(2222).." glosow na tak i "..getGlobalStorageValue(2223).." glosow na nie.")
	   addEvent(vote_clean, 2000)
         return 1
end
function onSay(cid, words, param)
local vote_end_time = 60 -- czas glosowania
         if getGlobalStorageValue(9955) ~= 1 then
                    if words == '/vote' then
                       addEvent(vote_end, vote_end_time * 1000)
                       doBroadcastMessage(""..param.." Aby zaglosowac uzyj !tak lub !nie .")
                       setGlobalStorageValue(9955, 1)
                    end
         end
     if getGlobalStorageValue(9955) == 1 then    
         if words == '!tak' and getPlayerStorageValue(cid,7236) <= os.time() then
           setGlobalStorageValue(2222, getGlobalStorageValue(2222) + 1)
           doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'Zaglosowales na tak.')
           setPlayerStorageValue(cid,7236, os.time()+(vote_end_time))
         elseif words == '!nie' and getPlayerStorageValue(cid,7236) <= os.time() then
           setGlobalStorageValue(2223, getGlobalStorageValue(2223) + 1)
           doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'Zaglosowales na nie.')
           setPlayerStorageValue(cid,7236, os.time()+(vote_end_time))
         elseif getPlayerStorageValue(cid,7236) >= os.time() then
           doPlayerSendCancel(cid,"Juz glosowales") 
         end
     else
         doPlayerSendCancel(cid,"Glosowanie nie zostalo rozpoczete.")
     end    
return 1
end



@EDIT
NIE DA?EM SKREENA BO OPISA?EM WSZYSTKO I NIE MOG? W TYM MOMENCIE GO ZROBI?
@edit2
Pozwalam kopiowa? skrypt na inne fora ALE trzeba da? link do TEGO tematu i NIE WOLNO usuwa? mojej stopki w skypcie
 
Odp: Vote System

to niema sensu. Pyta oco?, jest odpowiedz i co? Nic. Niepotrzebne lagi na serv
 
Odp: Vote System

@Up ty to masz chyba jakiego? laga na m?zgu. Dobry skrypt ale jeszcze by? zabezpieczy? ?eby si? nie mogli wylogowa? do ko?ca g?osowania jak ju? zag?osuj?.
 
Status
Zamknięty.
Back
Do góry