What's new

M?j Pierwszy Skrypt ;p (Panda Item)

Status
Not open for further replies.

PrO GrAcZ

Active User
Joined
Jun 5, 2010
Messages
56
Reaction score
7

Opis Skryptu:
-Gracz U?ywa Itemu o ID: 5080(Panda Teddy)
-Dostaje Outfit o ID: 4286(Panda)
-Dostaje 100Soula
-Dostaje Premium na 7dni.
-Usuwa Si? Item.
-Gdy Gracz U?yje Itemu Przenosi go Do Temple (1000 1000 7)
-Dostaje 1000 Expa
-Dostaje ?wiat?o na Godzin? (nie wiem na 100% czy zadzia?a)
-Gracz nie mo?e mie? pz
w data/actions/script zr?b plik o nazwie: pandaitem.lua i wklej do niego:

PHP:
local pzpos = getCreaturePosition(cid)
if (getTilePzInfo(pzpos) == 1) then  
function onUse(cid, item, frompos, item2, topos)
 if item.uid == 5080 then
        doPlayerAddOutfit(cid, 4286)
        local pzpos = getCreaturePosition(cid)
        if (getTilePzInfo(pzpos) == 1) then  
        doSetCreatureLight(cid, lightLevel, lightColor, 10000)
        doPlayerAddExp(cid,exp, expRate, 1000)
        doTeleportThing(cid, 1000 1000 7)
        doPlayerAddSoul(cid, 100)  
        addPremium(cid, 7)
        doRemoveItem(item.uid, 1) 
    end
end
return true
end
Potem wejd? w data/actions.xml otw?rz go notatnikiem i wklej do niego:
PHP:
<action itemid="5080" script="pandaitem.lua" />

Dodam, ?e jest to m?j pierwszy samo zrobiony skrypt. (Nie wiem na 100% ?e dzia?a ;p) Kto sprawdzi dostanie rep ;p
Prosz? o oceny.
 

raphy246

Active User
Joined
Nov 29, 2009
Messages
124
Reaction score
7
Odp: M?j Pierwszy Skrypt ;p (Panda Item)

Jak na pierwszy skrypt to nie?le, sam napisa?em pierwszy skrypt te? taki prosty. :p Skrypt mo?e si? komu? przyda. Na zach?t? 10/10.

PS.
Poleca?bym zamiast code:
Code:
function onUse(cid, item, frompos, item2, topos)
if item.uid == 5080 then
doPlayerSendTextMessage(cid,22,"Wlasnie Zostales Panda!")
doPlayerAddOutfit(cid, 4286)
doPlayerAddSoul(cid, 100)
doPlayerAddBlesing(cid, 5)
addPremium(cid, 7)
doRemoveItem(item.uid, 1)
end
end
return true
end
u?ywa? php:
PHP:
function onUse(cid, item, frompos, item2, topos)
if item.uid == 5080 then
doPlayerSendTextMessage(cid,22,"Wlasnie Zostales Panda!")
doPlayerAddOutfit(cid, 4286)
doPlayerAddSoul(cid, 100)
doPlayerAddBlesing(cid, 5)
addPremium(cid, 7)
doRemoveItem(item.uid, 1)
end
end
return true
end
 

Oskar

Forum friend
Joined
Jan 24, 2009
Messages
2,256
Reaction score
331
Odp: M?j Pierwszy Skrypt ;p (Panda Item)

PHP:
function onUse(cid, item, frompos, item2, topos)
if item.uid == 5080 then
        doPlayerSendTextMessage(cid,22,"Wlasnie Zostales Panda!")
        doPlayerAddOutfit(cid, 123)
        doPlayerAddSoul(cid, 100)  
        doPlayerAddBlesing(cid, 5)
        doPlayerAddPremiumDays(cid, 7)
        doRemoveItem(item.uid, 1) 
end
return true
end
U?ywasz z?ych funkcji.
 

raphy246

Active User
Joined
Nov 29, 2009
Messages
124
Reaction score
7
Odp: M?j Pierwszy Skrypt ;p (Panda Item)

Wedlug mnie powinno by? tak:

PHP:
function onUse(cid, item, frompos, item2, topos)
local config {outfit = 123, time = 99999999, soul = 100, bles = 5, item 5080, effect = 13}
local playerpos = getPlayerPosition(cid)
PlayerSendTextMessage(cid,22,"Wlasnie Zostales Panda!")
doCreatureChangeOutfit(cid, config.outfit, config.time)
doPlayerAddSoul(cid, config.soul)
doPlayerAddBlesing(cid, config.bles)
doRemoveItem(config.item, 1)
doSendMagicEffect(playerpos, config.effect)
end
end
return true
end

Jestem pocz?tkuj?cy, wi?c u mnie te? mog?by? b??dy. :p
 

Oskar

Forum friend
Joined
Jan 24, 2009
Messages
2,256
Reaction score
331
Odp: M?j Pierwszy Skrypt ;p (Panda Item)

Chcesz tabele? To masz.
PHP:
function onUse(cid, item, frompos, item2, topos)
local config = {
				[6568] = {change_out = "yes", outfit = 123, soul = "no", how_many_soul = 0, bless = "yes", how_many_bless = 5, prem = "yes", days_prem = 7},
				[6567] = {change_out = "no", outfit = 0, soul = "yes", how_many_soul = 100, bless = "no", how_many_bless = 0, prem = "yes", days_prem = 13},
				[6566] = {change_out = "yes", outfit = 100, soul = "yes", how_many_soul = 25, bless = "yes", how_many_bless = 3, prem = "no", days_prem = 0}
				}
local item = config[item.itemid]
if item then
	if item.change_out == "yes" then
		doPlayerAddOutfit(cid, item.outfit)
	end
	if item.soul == "yes" then
		doPlayerAddSoul(cid, item.how_many_soul)
	end
	if item.bless == "yes" then
		doPlayerAddBlesing(cid, item.how_many_bless)
	end
	if item.prem == "yes" then
		doPlayerAddPremiumDays(cid, item.days_prem)

	end
doRemoveItem(item.uid, 1)
doPlayerSendTextMessage(cid, 22, "Twoja maskotka ulegla zniszczeniu!")
end
return true
end
#up
Tw?j skrypt nie b?dzie dzia?a?.

#edit
Ka?dy pope?nia b??dy. Teraz dzia?a poprawnie.
 
Last edited:

Geragonixus

Active User
Joined
Jul 17, 2010
Messages
123
Reaction score
1
Odp: M?j Pierwszy Skrypt ;p (Panda Item)

Kto? mi da dzia?aj?cy? bo ka?dy pisze nie mo?esz u?y? czy co?
 

PrO GrAcZ

Active User
Joined
Jun 5, 2010
Messages
56
Reaction score
7
Odp: M?j Pierwszy Skrypt ;p (Panda Item)

PHP:
  function onUse(cid, item, frompos, item2, topos)
 if item.uid == 5080 then
        doPlayerSendTextMessage(cid,22,"Wlasnie Zostales Panda!")
        doPlayerAddOutfit(cid, 4286)
        doPlayerAddSoul(cid, 100)  
        doPlayerAddBlesing(cid, 5)
        addPremium(cid, 7)
        doRemoveItem(item.uid, 1) 
    end
end
return true
end
80%, ?e dzia?a

PHP:
function onUse(cid, item, frompos, item2, topos)
local config = {
                [6568] = {change_out = "yes", outfit = 123, soul = "no", how_many_soul = 0, bless = "yes", how_many_bless = 5, prem = "yes", days_prem = 7},
                [6567] = {change_out = "no", outfit = 0, soul = "yes", how_many_soul = 100, bless = "no", how_many_bless = 0, prem = "yes", days_prem = 13},
                [6566] = {change_out = "yes", outfit = 100, soul = "yes", how_many_soul = 25, bless = "yes", how_many_bless = 3, prem = "no", days_prem = 0}
                }
local item = config[item.itemid]
if item then
    if item.change_out == "yes" then
        doPlayerAddOutfit(cid, item.outfit)
    elseif item.soul == "yes" then
        doPlayerAddSoul(cid, item.how_many_soul)
    elseif item.bless == "yes" then
        doPlayerAddBlesing(cid, item.how_many_bless)
    elseif item.ptem == "yes" then
        doPlayerAddPremiumDays(cid, item.days_prem)
    end
doRemoveItem(item.uid, 1)
doPlayerSendTextMessage(cid, 22, "Twoja maskotka ulegla zniszczeniu!")
end
return true
end
99% ze dzia?a (by Oskar)
 
Last edited:

raphy246

Active User
Joined
Nov 29, 2009
Messages
124
Reaction score
7
Odp: M?j Pierwszy Skrypt ;p (Panda Item)

Dzi?ki Oskar za poprawienie. Jak ju? ty napisa?e? to musi dzia?a?. :p

PS.
Po zastosowaniu php, od razu lepiej wygl?da. :)
 

PrO GrAcZ

Active User
Joined
Jun 5, 2010
Messages
56
Reaction score
7
Odp: M?j Pierwszy Skrypt ;p (Panda Item)

Refresz

///Daj Komenta a dam ci Reputa ;p
 

mates130

Active User
Joined
May 12, 2009
Messages
113
Reaction score
5
Odp: M?j Pierwszy Skrypt ;p (Panda Item)

Wed?ug mnie b. dobrze !! b?d? musia? wypr?bowa? na swoim otsie
 

Diablo9515

Banned
Joined
Feb 20, 2010
Messages
214
Reaction score
14
Age
28
Odp: M?j Pierwszy Skrypt ;p (Panda Item)

Jak na pierwszy raz to naprawd? bardzo dobrze. Dam Ci 10/10, nie przerywaj swojej pracy.
Licz? na Ciebie!


Pozdrawiam!!
 

Bubin

Senior User
Joined
May 13, 2009
Messages
1,113
Reaction score
169
Age
26
Odp: M?j Pierwszy Skrypt ;p (Panda Item)

@refresz

//Skomentuj a Dam ci Reputa!
 

marcinhave

New User
Joined
Feb 5, 2010
Messages
9
Reaction score
2
Odp: M?j Pierwszy Skrypt ;p (Panda Item)

Powiem ?e nie jest ?le jak na 1 raz postaraj si? teraz co? bardziej zaawansowanego zrobi? :)
 

marcinhave

New User
Joined
Feb 5, 2010
Messages
9
Reaction score
2
Odp: M?j Pierwszy Skrypt ;p (Panda Item)

2x klikne?em sorki prosz? o usuni?cie postu
 

Joke1991

Active User
Joined
Sep 12, 2008
Messages
97
Reaction score
6
Odp: M?j Pierwszy Skrypt ;p (Panda Item)

Skrypt nie jest zbyt zaawansowany lecz jak na pocz?tkuj?cego mo?e by? :) ?ycz? ci dalszych sukces?w :D
 

Codo7711

Active User
Joined
Jun 29, 2009
Messages
128
Reaction score
9
Odp: M?j Pierwszy Skrypt ;p (Panda Item)

mowisz ze to twoj 1 tak ? , no to gratulacje ;] sprawdzalem go , troszke pozmienialem ale ogolnie jest ok ^^
 

Interior

Active User
Joined
May 21, 2010
Messages
127
Reaction score
23
Odp: M?j Pierwszy Skrypt ;p (Panda Item)

Jak na pierwszy skrypt nie jest ,a? tak bardzo ?le. Fajny ten pomys? z t? Pand?. Pod szlifuj swoje umiej?tno?ci, a mo?e staniesz si? porz?dnym skrypterem. Ja ?ycz? Ci powodzenia!
 

pery97

Advanced User
Joined
Jul 26, 2009
Messages
257
Reaction score
21
Odp: M?j Pierwszy Skrypt ;p (Panda Item)

na pierwszy raz gitez ;p
 

Lotherad

Active User
Joined
Aug 7, 2010
Messages
73
Reaction score
2
Odp: M?j Pierwszy Skrypt ;p (Panda Item)

Nie?le, co prawda nie umiem robi? skrypt?w, ale fajnie to wygl?da :p Jest na forum jaki? tutorial/vademecum robienia skrypt?w?
 
Last edited:

Tayfoon

Advanced User
Joined
Jul 29, 2009
Messages
239
Reaction score
12
Odp: M?j Pierwszy Skrypt ;p (Panda Item)

Jak na pocz?tkuj?cego to dobrze. Po modyfikacji - WSZYSTKO GRA I BUCZY xDD
Dobra robota!



Pozdrawiam i ?ycz? sukces?w,
Tayfoon
 
Status
Not open for further replies.
Top