What's new

[Sprawdzenie skryptu]

Status
Not open for further replies.

DraxY

Advanced User
Joined
May 4, 2008
Messages
182
Reaction score
14
Age
29
Witam, zrobi?em skrypt, dla zabawy bo chc? sie nauczy? robi? dobre skrypty ;p wi?c od czego? trzeba zacz?? .. prosz? o sprawdzenie tego skryptu, gdy? ja nie mam mo?liwo?ci ;/
Code:
-------"Training Scritp By Arkam Shadow"----------
local pos = getPlayerPosition(cid)
local efekty = math.random(1, 30)
function onUse(cid, item, frompos, item2, topos) 
                  if getPlayerLevel(cid) >= 100 or getPlayerMagLevel(cid) >= 80 then
                  if getPlayerGroupId(cid) == 0 or getPlayerGroupId(cid) == 1 then
                  if getPlayerMana(cid) == getPlayerMaxMana(cid) then
            doSendMagicEffect(pos, efekty) and doPlayerSendCancel(cid,"Jestes Poteznym Wojownikiem, jednak twoje sily sa zbyt male aby uruchomic portal")
          elseif getTilePzInfo(pos) == true then
            doSendMagicEffect(pos, efekty) and doPlayerSendCancel(cid,"Wyidz ze strefy ochronnej")
end
        return true
end
                 if getPlayerLevel(cid) >= 250 and getPlayerMagLevel(cid) >= 90 then
                 if getPlayerGroupId(cid) == 0 or getPlayerGroupId(cid) == 1 then
            doSendMagicEffect(pos, efekty)
            doPlayerAddItem(cid, 2160, 90)
			     if getTilePzInfo(pos) == false then
			doPlayerSendCancel(cid,"Twoja moc zostala wykorzystana, zmaterializowales 90cc")
else
            doPlayerSendCancel(cid,"Twoja wiara jest zbyt mala abys co kolwiek stworzyl")
end
return true
end
end
end
end

Jezeli jest cos zle prosze o wyt?umaczenie .
Pozdrawiam Arkam Shadow

@Down, dzieki za pomoc ;d zaraz zrobie jakis skrypt dla zabawy jescze xD
 
Joined
Aug 7, 2009
Messages
38
Reaction score
2
Odp: [Sprawdzenie skryptu]

Witam, zrobi?em skrypt, dla zabawy bo chc? sie nauczy? robi? dobre skrypty ;p wi?c od czego? trzeba zacz?? .. prosz? o sprawdzenie tego skryptu, gdy? ja nie mam mo?liwo?ci ;/
-------"Training Scritp By Arkam Shadow"----------
local pos = getPlayerPosition(cid)
local efekty = math.random(1, 30)
function onUse(cid, item, frompos, item2, topos)
if (getPlayerLevel(cid) >= 100 or getPlayerMagLevel(cid) >= 80) then
if (getPlayerGroupId(cid) == 0 or getPlayerGroupId(cid) == 1) then
if (getPlayerMana(cid) == getPlayerMaxMana(cid)) then
doSendMagicEffect(pos, efekty) and doPlayerSendCancel(cid,"Jestes Poteznym Wojownikiem, jednak twoje sily sa zbyt male aby uruchomic portal")
elseif getTilePzInfo(pos) == true then
doSendMagicEffect(pos, efekty) and doPlayerSendCancel(cid,"Wyidz ze strefy ochronnej")
end
return true
end
if (getPlayerLevel(cid) >= 250 and getPlayerMagLevel(cid) >= 90) then
if (getPlayerGroupId(cid) == 0 or getPlayerGroupId(cid) == 1) then
doSendMagicEffect(pos, efekty)
doPlayerAddItem(cid, 2160, 90)
if (getTilePzInfo(pos) == false) then
doPlayerSendCancel(cid,"Twoja moc zostala wykorzystana, zmaterializowales 90cc")
else
doPlayerSendCancel(cid,"Twoja wiara jest zbyt mala abys co kolwiek stworzyl")
end
return true
end
end
end
end
Jezeli jest cos zle prosze o wyt?umaczenie .
Pozdrawiam Arkam Shadow

Nawiasy chyba s? potrzebne :p Ucz? si? te? dopiero "gramatyki" skrypt?w, wi?c nie zauwa?y?em wi?cej b??d?w...
 

Deaven

Advanced User
Joined
Mar 25, 2009
Messages
422
Reaction score
77
Odp: [Sprawdzenie skryptu]

Nawiasy nie s? potrzebne, u?atwiaj? prac?;)
Strasznie chaotycznie napisane:p, nie wiem czy dobrze to zrozumia?em, ale nie potrzebna jest zupe?nie pierwsza cz??? skryptu:
Code:
if [B]([/B]getPlayerLevel(cid) >= 100 or getPlayerMagLevel(cid) >= 80[B])[/B] then
                  if [B]([/B]getPlayerGroupId(cid) == 0 or getPlayerGroupId(cid) == 1[B])[/B] then
                  if [B]([/B]getPlayerMana(cid) == getPlayerMaxMana(cid)[B])[/B] then
doSendMagicEffect(pos, efekty) and doPlayerSendCancel(cid,"Jestes Poteznym Wojownikiem, jednak twoje sily sa zbyt male aby uruchomic portal")
          elseif getTilePzInfo(pos) == true then
            doSendMagicEffect(pos, efekty) and doPlayerSendCancel(cid,"Wyidz ze strefy ochronnej")
end
        return true
end
Nie ma sensu deklarowa? co? tylko dlatego, ?eby napisa?, ?e nie spe?nia warunk?w, tym bardziej, ?e w kolejnej cz??ci, napisa?e? podobnie;)
Ka?dy "if" musi zako?czy? si? "end'em", mo?na je zagnie?d?a? w sobie, ale to musi by? kontrolowane. Skoro najpierw da?e? 3 "if", to musisz zako?czy? 3 "end". Najlepiej nauk? zacznij od czego prostego;)
 
Status
Not open for further replies.
Top