What's new

B??dne skrypty

Status
Not open for further replies.

Mackowy

User
Joined
Feb 24, 2010
Messages
32
Reaction score
2
Witam,
Mam problem ze skryptami..
to tak s? od soft?w Jedne do kupienia, drugie do naprawy
Do kupienia sa za 250cc
a do naprawy za 1cc

Chodzi mi o to ?e s? ju? na mapie dane, nie da si? ich wzi?? itp, ale po klikni?ciu nie daje, ani nie naprawia soft?w..
oto skrypty :

DO KUPIENIA
function onUse(cid, item, frompos, item2, topos)
if doPlayerRemoveItem(cid,2160,250) == 0 then
doPlayerAddItem(cid,2640,1)
doPlayerSendTextMessage(cid,22, "Nie masz tyle kasy")
end

DO NAPRAWY
function onUse(cid, item, frompos, item2, topos)
if getPlayerItemCount(cid,6530) >= 1 and getPlayerItemCount(cid,2160) >= 1 then
if doPlayerTakeItem(cid,6530,1) and doPlayerTakeItem(cid,2160,1) == 0 then
doPlayerAddItem(cid,2640,1)
doPlayerSendTextMessage(cid,22, "Nie masz softow lub kasy!")
end
end

czkeam na pomoc! oczywi?cie za pomoc dam reputa!
 

lisex dwaa

Advanced User
Joined
Feb 20, 2010
Messages
244
Reaction score
26
Odp: B??dne skrypty

DO NAPRAWY
function onUse(cid, item, frompos, item2, topos)
if getPlayerItemCount(cid,6530) >= 1 and getPlayerItemCount(cid,2160) >= 1 then
if doPlayerTakeItem(cid,6530,1) and doPlayerTakeItem(cid,2160,1) == 0 then
doPlayerAddItem(cid,2640,1)
doPlayerSendTextMessage(cid,22, "Nie masz softow lub kasy!")
end
end
dokoncz funkcje czyli tak:porprawny skrypt
function onUse(cid, item, frompos, item2, topos)
if getPlayerItemCount(cid,6530) >= 1 and getPlayerItemCount(cid,2160) >= 1 then
if doPlayerTakeItem(cid,6530,1) and doPlayerTakeItem(cid,2160,1) == 0 then
doPlayerAddItem(cid,2640,1)
doPlayerSendTextMessage(cid,22, "Nie masz softow lub kasy!")
end
end
end
DO KUPIENIA
function onUse(cid, item, frompos, item2, topos)
if doPlayerRemoveItem(cid,2160,250) == 0 then
doPlayerAddItem(cid,2640,1)
doPlayerSendTextMessage(cid,22, "Nie masz tyle kasy")
end
a to poprawny:
function onUse(cid, item, frompos, item2, topos)
if doPlayerRemoveItem(cid,2160,250) == 0 then
doPlayerAddItem(cid,2640,1)
doPlayerSendTextMessage(cid,22, "Nie masz tyle kasy")
end
end
powinno dzialac
 

Mackowy

User
Joined
Feb 24, 2010
Messages
32
Reaction score
2
Odp: B??dne skrypty

@up
Ok, wszystko dzia?a, ale
je?li nie mam 250cc to i tak da mi softy...
a naprawa dalej nie dziala
 

krysteek

Advanced User
Joined
Sep 6, 2008
Messages
273
Reaction score
15
Odp: B??dne skrypty

Oto skrypt na kupywanie:
Code:
function onUse(cid, item, frompos, item2, topos)
if getPlayerItemCount(cid,2160,250) then
doPlayerRemoveItem(cid,2160,250)
doPlayerAddItem(cid,2640,1)
doPlayerSendTextMessage(cid,22, "You bought Soft Boots.")
else
doPlayerSendTextMessage(cid,22, "You dont have enough money.")
end
end

A oto skrypt na naprawianie:
Code:
function onUse(cid, item, frompos, item2, topos)
if getPlayerItemCount(cid,6530) >= 1 and getPlayerItemCount(cid,2160) >= 1 then
doPlayerRemoveItem(cid,6530)
doPlayerRemoveItem(cid,2160,1)
doPlayerAddItem(cid,2640,1)
doPlayerSendTextMessage(cid,22, "You repair soft boots.!")
else
doPlayerSendTextMessage(cid,22, "You dont have enough money or soft boots.")
end
end
 

Maniucza

Advanced User
Joined
Jan 18, 2009
Messages
374
Reaction score
57
Odp: B??dne skrypty

Witam, skrypty zosta?y troch? zle napisane nie w tej funcjo co trzeba
Data/talkactions/buysoft.lua
PHP:
function onSay(cid, words, param, channel)
	if(param == '') then
		return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.")
	end

	if doPlayerRemoveItem(cid, 2160, 250) then
		doPlayerAddItem(cid, 2640, 1)
		doPlayerSendTextMessage(cid, 22, "Kuples soft boots.")
	else
		doPlayerSendTextMessage(cid, 22, "Nie masz tyle kasy")
	end
	return true
end

Data/talkactions.xml
PHP:
<talkaction words="!buysoft" event="script" value="buysoft.lua"/>

Pozdrawiam.
 
Last edited:

lisex dwaa

Advanced User
Joined
Feb 20, 2010
Messages
244
Reaction score
26
Odp: B??dne skrypty

moge ci dac do naprawy w formie talkactions jak chcesz to napisz!!
 

Mackowy

User
Joined
Feb 24, 2010
Messages
32
Reaction score
2
Odp: B??dne skrypty

Dzi?ki Krystek i Maniucza, po repucie!
Mo?na zamkn??
 
Status
Not open for further replies.
Top