What's new

Quest RPG

Status
Not open for further replies.
T

Tairens

Guest
Praca konkursowa.
Autor: Punis
Link:
Kod:
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local storage   = 510
local nagroda5  =  3288, 1
local nagroda6  =  5803, 1
local nagroda7  =  3321, 1
local nagroda8  =  3321, 1
if(getPlayerVocation(cid) == 5) then
if getPlayerStorageValue(cid, storage) < 0 then
doPlayerAddItem(cid, nagroda5)
else
doPlayerSendTextMessage(cid, 22, "Nie spelniasz warunkow")
if(getPlayerVocation(cid) == 6) then
if getPlayerStorageValue(cid, storage) < 0 then
doPlayerAddItem(cid, nagroda6)
else
doPlayerSendTextMessage(cid, 22, "Nie spelniasz warunkow")
if(getPlayerVocation(cid) == 7) then
if getPlayerStorageValue(cid, storage) < 0 then
doPlayerAddItem(cid, nagroda7)
else
doPlayerSendTextMessage(cid, 22, "Nie spelniasz warunkow")
if(getPlayerVocation(cid) == 8) then
if getPlayerStorageValue(cid, storage) < 0 then
doPlayerAddItem(cid, nagroda8)
else
doPlayerSendTextMessage(cid, 22, "Nie spelniasz warunkow")
end
end
Filmik z dzia?ania(wymagany w tej rundzie): Niestety, nie mia?em okazji stworzy?.
Dodatkowe informacje: -
 
T

Tairens

Guest
Odp: #2 QuestRPG - Punis Punkty:

Odp: #2 QuestRPG - Punis Punkty:

Bardzo s?aby skrypt, chyba nie musz? komentowa?.Zastosowano najprostsz? z podanych technik programowania 3/10.
 

YoS

Advanced User
Joined
Aug 29, 2008
Messages
410
Reaction score
32
Odp: Quest RPG

hah prosciej to by sie dalo tylko bez zmiennych : P (tzn prymitywniej*)
ogolnie skrypt jest.. hmmmm... nie jak praca konkursowa.. jednakze kiedys na takich sie jechalo ;)
ogolnie MOZE poczatkujacym skrypterom sie to przyda jako "przyklad" jak NIE robic... gdyz tu brakuje tyle endow.. ; ( do tego skrzynka sie otworzy [ jak skrzynki uzyjesz] ehhh : P
 

Wizardix

Active User
Joined
Sep 27, 2010
Messages
128
Reaction score
1
Odp: Quest RPG

Naprawd? banalny Quest, skrypt niekompletny... 2/10
 

Don Muha

Advanced User
Joined
Aug 27, 2008
Messages
403
Reaction score
34
Odp: Quest RPG

Ten skrypt wog?le dzia?a?
Taki skrypt mo?na w kilka sekund zrobi? i o wiele kr?tszy:
PHP:
local config = {
	storageValue = 510
}
local vocations = {5, 6, 7, 8}
local rewards = {3288, 5803, 3321}
function onUse(cid, item, fromPosition, itemEx, toPosition)
	for i, voc in ipairs(vocations) do
		if(getPlayerVocation(cid) == voc) then
			if(getPlayerStorageValue(cid, config.storageValue) == config.storageValue) then
				doPlayerAddItem(cid, rewards[i], 1)
				doPlayerSendTextMessage(cid, 22, "Nie spelniasz warunkow")
			end
		end
	end
end
 
Status
Not open for further replies.
Top