• logo_cipsoft
    Nowe serwery zostały otwarte 27 Sie 2025:
    Escura (Retro Open PvP) Mystera (Retro Open PvP) us_logo Penumbra (Retro Open PvP)

Support - pomoc przy pisaniu skrypt?w

Status
Zamknięty.
Odp: Support - pomoc przy pisaniu skrypt?w

Slyszales o takim pliku SCIPTSYSTEM_HELP, bo chyba nie.
Cytuje:
Kod:
*MOVEMENTS
		File: movements/movements.xml
		Attributes
			type/event
				Values:
					StepIn, StepOut
					Equip, DeEquip
					AddItem, RemoveItem
			slot
				Values:
					head
					necklace
					backpack
					armor
					right-hand, left-hand
					two-handed, hand/shield
					legs
					feet
					ring
					ammo
			tileitem
				Defines if it is a tile item.
			level
				You can specify level required to use this item.
			maglevel
				Magic level required.
			premium
				Premium needed?
				Values: yes/no
			function
				Default hardcoded functions.
				Values:
					onStepInField
					onStepOutField
					onAddField
					onRemoveField
					onEquipItem
					onDeEquipItem
		Functions
			[SIZE="4"][B]onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)[/B][/SIZE]
			onStepOut(cid, item, position, lastPosition, fromPosition, toPosition, actor)
			onEquip(cid, item, slot)
			onDeEquip(cid, item, slot)
			onAddItem(moveItem, tileItem, position, cid)
			onRemoveItem(moveItem, tileItem, position, cid)

Wiec sam pocwicz, bo ja juz cwiczylem. Skrypt moze i z tfs'a, ale Elfowi szkoda czasu na poprawieniu 1. linijki w kilkunastu skryptach ;f
 
Ostatnia edycja:
Odp: Support - pomoc przy pisaniu skrypt?w

Ty jeste? oporny na informacje <lol2>

Patrz jak zrobi? co? takiego
Kod:
function onUse(tairens, mistrz, miazdzy, ldrozda, zawsze)
if(isPlayer(tairens)) then
end
end
To te? zadzia?a!
Tutaj dzia?a domniemanie jak wiesz co to oznacza, nie musisz wyr??ni? wszystkich argument?w, a do tego z tej ilo?ci argument?w korzystaj? developerzy TFS, to dlaczego przy moim u?yciu to nie ma dzia?a? i by? b??dem, zrobi?e? b??d to podkul ogon i pracuj dalej.
 
Odp: Support - pomoc przy pisaniu skrypt?w

Chcia?em si? zapyta? czy kto? mi wre?cie pomoze..


Siema, mam problem w tym skrypcie. Wpisuje id itemka ?adnie odbanowywuje, zabiera itemka, lecz mo?na odbanowywa? tak?e bez tego itemka.. jak zrobi? ?eby mo?na by?o odbanowywa? chara tylko z tym itemkiem..
Oto skrypt.

function onSay(cid, words, param, channel)
local itemek = 2160
if(param == '') then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.")
return true
end

local account, tmp = getAccountIdByName(param), true
if(account == 0) then
account = getAccountIdByAccount(param)
if(account == 0) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player or account '" .. param .. "' does not exists.")
return true
end

tmp = false
end

local ban = getBanData(account, BAN_ACCOUNT)
if(ban and doRemoveAccountBanishment(account)) then
local name = param
if(tmp) then
name = account
end

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, name .. " has been " .. (ban.expires == -1 and "undeleted" or "unbanned") .. ".")
doPlayerRemoveItem(cid, itemek, 1)
end

if(not tmp) then
return true
end

tmp = getIpByName(param)
if(isIpBanished(tmp) and doRemoveIpBanishment(tmp)) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "IP Banishment on " .. doConvertIntegerToIp(ip) .. " has been lifted.")
doPlayerRemoveItem(cid, itemek, 1)
end

local guid = getPlayerGUIDByName(param, true)
if(guid == nil) then
return true
end

ban = getBanData(guid, BAN_PLAYER, PLAYERBAN_LOCK)
if(ban and doRemovePlayerBanishment(guid, PLAYERBAN_LOCK)) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Namelock from " .. param .. " has been removed.")
doPlayerRemoveItem(cid, itemek, 1)
end

ban = getBanData(guid, BAN_PLAYER, PLAYERBAN_BANISHMENT)
if(ban and doRemovePlayerBanishment(guid, PLAYERBAN_BANISHMENT)) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, param .. " has been " .. (ban.expires == -1 and "undeleted" or "unbanned") .. ".")
doPlayerRemoveItem(cid, itemek, 1)
end

return true
end
 
Odp: Support - pomoc przy pisaniu skrypt?w

Ty jeste? oporny na informacje <lol2>
Patrz jak zrobi? co? takiego
Kod:
function onUse(tairens, mistrz, miazdzy, ldrozda, zawsze)
if(isPlayer(tairens)) then
end
end
To te? zadzia?a!
Tutaj dzia?a domniemanie jak wiesz co to oznacza, nie musisz wyr??ni? wszystkich argument?w, a do tego z tej ilo?ci argument?w korzystaj? developerzy TFS, to dlaczego przy moim u?yciu to nie ma dzia?a? i by? b??dem, zrobi?e? b??d to podkul ogon i pracuj dalej.
No co ty powiesz. Serio, ze zadziala? Pewnie, ze zadziala osle. >.> A jak juz cos robisz to rob to dobrze. A jak nie to nie zagladaj do tego watku.
Popracuj sobie w kiblu, moze rozladujesz emocje ;)

Pozdrawiam goraco,

PS Skoro mnie poprawiles to dobrze. Cieszy mnie to, ze znalazles blad i dzieki temu tamtemu koledze zadziala skrypt. Ale po co poprawiles 1. linie? Bo myslales, ze jest blednie? =)

PS2 Walczyc z Toba nie bede. Walcz sam ze soba i nie badz pyszalkiem. ;f

# aff, tak, zgadza sie! Napisalem przeciez, ze dobrze ze mnie poprawiles. Tylko nie rozumialem, po co zmieniles funkcje jak ona byla dobrze.
 
Ostatnia edycja:
Odp: Support - pomoc przy pisaniu skrypt?w

Ja nie my?la?em ona by?a ?le:
Kod:
if losuj = 4 then
to nie to samo co
Kod:
if losuj == 4 then
Nadanie warto?ci, a por?wnanie i jeszcze masz jakie? kwestie do obgadania czy mog? ju? zamkn?? kart? tibia.net?
 
Odp: Support - pomoc przy pisaniu skrypt?w

Mam wielka prosbe a mianowicie:
1.Skrypt na usuwanie wszystkich fragow za pomoca itemka pod tibie 8.54 (usuwa ona wszystkie fragi oraz rs) mozna jej uzyc jezeli sie niema krzyzyka (pz)
2.Skrypt na zmiane nicku aby na stronce w sms shopie mozna bylo za pkt kliknac o zmiane nicku takze pod 8.54
Za pomoc reput

Moglby mi ktos pomoc ^^
 
Ostatnia edycja:
Odp: Support - pomoc przy pisaniu skrypt?w

Mo?e zamiast k??ci? si? o ma?y b??d (mimo ?e psuje on ca?y skrypt ale jest to tylko ma?a pomy?ka) zaczniemy dalej funkcjonowa? w tym temacie? Ca?? stron? k??cicie si? o argumenty w funkcji bo kto? ich da? za du?o. Na pocz?tku strony by?a pro?ba i na ko?cu nadal si? powt?rzy?a bo wolicie si? pok??ci? o styl pracy, kt?ry w tym przypadku ma znikome znaczenie w dzia?aniu skryptu.


A co do u?ytkownika lewy12, na 1 raczej nie jestem w stanie Ci pom?c poniewa? RS jest zapisywany na postaci w bazie danych. Mo?na napisa? pro?ciutki skrypt onUse kt?ry wchodzi w baz? danych i zamienia to pole na 0 (poniewa? 0 to brak rs'a) lecz posta? nadal b?dzie na starych ustawieniach i gdy wylogujesz posta? zapisz? si? dane kt?re masz na postaci w danym momencie czyli tak?e RS. Do tego trzeba chyba (nie jestem pewny wi?c mile widziane poprawki) pisa? funkcje w source kt?ra na "?ywca" usunie rsa z postaci oraz z bazy danych (w razie crasha aby rs by? usuni?ty).

Co do twojej 2 pro?by, s?aby jestem w PHP wi?c takiego skryptu ci nie przygotuje, a je?li chodzi o zmian? nicku w grze, TFS'y maj? ju? te funkcje (uaktywnia si? w przypadku Rule Violation w Name Report), oraz ACC makery przystosowane do tego silnika (chyba te od tibi 8.50+) maj? ju? w sms shop wbudowane kupowanie namelocka.


PS: Wybacz, m?j b??d w 1 pro?bie, ju? takie funkcje istniej?. Masz tu przyk?ad takiego skryptu:
!rs - Czyszczenie frag?w na 0.3.5pl1
 
Ostatnia edycja:
Odp: Support - pomoc przy pisaniu skrypt?w

http://tibia.net.pl/actions/248319-tfs-0-3-6pl1-frag-skull-remover.html
Jak Ci nie bedzie pasowalo talkaction to sobie przerob na actions.
I dla kolegi specjalnie:
INFO: TO NIE JEST FABRYKA SKRYPTOW. MY TYLKO POMAGAMY JE ROBIC, PODAJAC NP. WSKAZOWKI!!

Ale mi chodzi o to aby kliknac itemka i rs znika przeciez widzialem taki na tibi 8.50 prawie na kazdym ots wiec na 8.54 to chyba dla was nieproblem??
Prosze jezeli mi to ktos napisze dam reputa
 
Odp: Support - pomoc przy pisaniu skrypt?w

Ale mi chodzi o to aby kliknac itemka i rs znika przeciez widzialem taki na tibi 8.50 prawie na kazdym ots wiec na 8.54 to chyba dla was nieproblem??
Prosze jezeli mi to ktos napisze dam reputa
Najpierw opisz? Ci to tak:
Zanim napiszesz cokolwiek to od 50 odejmij sw?j wiek. Otrzymany wynik zapisz na kartce. Wypowiedz g?o?no liczb? zapisan? na kartce. Wypowiedziana przez Ciebie liczba to liczba ile razy musisz przeczyta? posty innych i zastanowi? si? nad swoj? wypowiedzi?. Je?eli nie potrafisz odejmowa? to musisz tak d?ugo my?le? nad tym co napisa?, a? si? nauczysz odejmowania.


W Actions/scripts utw?rz plik o nazwie
Kod:
skull remove.lua
Wklej do tego pliku
PHP:
function onUse(cid, item, frompos, item2, topos)
doCreatureSay(cid,"Your frags and skull have been removed.",TALKTYPE_ORANGE_1)
db.executeQuery("UPDATE `killers` SET `unjustified` = 0 WHERE `id` IN (SELECT `kill_id` FROM `player_killers` WHERE `player_id` = " .. getPlayerGUID(cid) .. ")")
doPlayerSetSkullEnd(cid, 0, SKULL_RED)            
doCreatureSetSkullType(cid, SKULL_NONE)
doRemoveItem(item.uid, 1)
return true
end
Wejd? do pliku wy?ej, czyli actions. Tam masz plik actions.xml zedytuj go wklejaj?c to:
Kod:
<action itemid="2307" script="skull remove.lua" />
Tam gdzie jest 2307, wklej id itemka, kt?rego chcesz u?ywa?.
 
Odp: Support - pomoc przy pisaniu skrypt?w

Thx Daman masz reput a moglbys napisac mi jeszcze linijke jaka mam wkleic zeby niemozna go bylo uzywac gdy sie ma pz (krzyzyk) plx

Daman ten twoj skrypt cos niedziala scrashowal mi serva
 
Ostatnia edycja:
Odp: Support - pomoc przy pisaniu skrypt?w

Chcia?bym ten skrypt na actions:

PHP:
function onSay(cid, words, param, channel)
	local data = {
		points = 20,
		skull = getCreatureSkullType(cid),
		removeFrags = "true",
		useLog = "false"
	}
	local exhaust = createConditionObject(CONDITION_EXHAUST)
	setConditionParam(exhaust, CONDITION_PARAM_TICKS, (getConfigInfo('timeBetweenExActions') - 100))
	if(hasCondition(cid, CONDITION_EXHAUST_HEAL)) then
		doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUAREEXHAUSTED)
		return true
	end
	if(data.skull == SKULL_RED or data.skull == SKULL_BLACK) then
		local query = db.getResult("SELECT `premium_points` FROM `accounts` WHERE `id` = " .. getPlayerAccountId(cid) .. ";")
		local playerPremiumPoints = query:getDataInt("premium_points")
		local remainingPoints = playerPremiumPoints - data.points
		if(playerPremiumPoints >= data.points) then
			local updateDatabase = db.executeQuery("UPDATE `accounts` SET `premium_points`= " .. remainingPoints .. " WHERE `id`= " .. getPlayerAccountId(cid) .. ";")
			if(updateDatabase == true) then            
				doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "Your skull has been taken off!\nRemaining premium points: " .. remainingPoints)
				doCreatureSetSkullType(cid, SKULL_NONE)
				if(getBooleanFromString(data.useLog) == true) then
					doWriteLogFile("./data/logs/removeskull.log", "Success: " .. getCreatureName(cid))
				end
				if(getBooleanFromString(data.removeFrags) == true) then
					doPlayerSetRedSkullTicks(cid, 0)
				end
				doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MAGIC_BLUE)
			else
				doPlayerSendCancel(cid, "Database error, please contact server staff.")
			end
		else
			doPlayerSendCancel(cid, "Sorry, you need " .. data.points .. " premium points to remove skull.")
       end
	else
		doPlayerSendCancel(cid, "Sorry, you don't have skull.")
	end
	if(query ~= nil) then
		query:free()
	end
	doAddCondition(cid, exhaust)
	return true
end

M?g? by? pokaza? jak by wygl?da? ten skrypt tylko ?e pod action? Bo chcia? bym sobie potem por?wna? i zobaczy? czym to si? ro?ni.
 
Odp: Support - pomoc przy pisaniu skrypt?w

W Actions/scripts utw?rz plik o nazwie
Kod:
skull remove.lua
Wklej do tego pliku
PHP:
function onUse(cid, item, frompos, item2, topos)
doCreatureSay(cid,"Your frags and skull have been removed.",TALKTYPE_ORANGE_1)
db.executeQuery("UPDATE `killers` SET `unjustified` = 0 WHERE `id` IN (SELECT `kill_id` FROM `player_killers` WHERE `player_id` = " .. getPlayerGUID(cid) .. ")")
doPlayerSetSkullEnd(cid, 0, SKULL_RED)            
doCreatureSetSkullType(cid, SKULL_NONE)
doRemoveItem(item.uid, 1)
return true
end
Wejd? do pliku wy?ej, czyli actions. Tam masz plik actions.xml zedytuj go wklejaj?c to:
Kod:
<action itemid="2307" script="skull remove.lua" />
Tam gdzie jest 2307, wklej id itemka, kt?rego chcesz u?ywa?.

Moglby ktos poprawic ten skrypt bo niedziala
 
Ostatnia edycja:
Odp: Support - pomoc przy pisaniu skrypt?w

Chcia?bym ten skrypt na actions:
PHP:
function onSay(cid, words, param, channel)
    local data = {
        points = 20,
        skull = getCreatureSkullType(cid),
        removeFrags = "true",
        useLog = "false"
    }
    local exhaust = createConditionObject(CONDITION_EXHAUST)
    setConditionParam(exhaust, CONDITION_PARAM_TICKS, (getConfigInfo('timeBetweenExActions') - 100))
    if(hasCondition(cid, CONDITION_EXHAUST_HEAL)) then
        doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUAREEXHAUSTED)
        return true
    end
    if(data.skull == SKULL_RED or data.skull == SKULL_BLACK) then
        local query = db.getResult("SELECT `premium_points` FROM `accounts` WHERE `id` = " .. getPlayerAccountId(cid) .. ";")
        local playerPremiumPoints = query:getDataInt("premium_points")
        local remainingPoints = playerPremiumPoints - data.points
        if(playerPremiumPoints >= data.points) then
            local updateDatabase = db.executeQuery("UPDATE `accounts` SET `premium_points`= " .. remainingPoints .. " WHERE `id`= " .. getPlayerAccountId(cid) .. ";")
            if(updateDatabase == true) then            
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "Your skull has been taken off!\nRemaining premium points: " .. remainingPoints)
                doCreatureSetSkullType(cid, SKULL_NONE)
                if(getBooleanFromString(data.useLog) == true) then
                    doWriteLogFile("./data/logs/removeskull.log", "Success: " .. getCreatureName(cid))
                end
                if(getBooleanFromString(data.removeFrags) == true) then
                    doPlayerSetRedSkullTicks(cid, 0)
                end
                doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MAGIC_BLUE)
            else
                doPlayerSendCancel(cid, "Database error, please contact server staff.")
            end
        else
            doPlayerSendCancel(cid, "Sorry, you need " .. data.points .. " premium points to remove skull.")
       end
    else
        doPlayerSendCancel(cid, "Sorry, you don't have skull.")
    end
    if(query ~= nil) then
        query:free()
    end
    doAddCondition(cid, exhaust)
    return true
end
M?g? by? pokaza? jak by wygl?da? ten skrypt tylko ?e pod action? Bo chcia? bym sobie potem por?wna? i zobaczy? czym to si? ro?ni.


PHP:
function onUse(cid, item, fromPosition, itemEx, toPosition)
    local data = {
        points = 20,
        skull = getCreatureSkullType(cid),
        removeFrags = "true",
        useLog = "false"
}
	
    if(data.skull == SKULL_RED or data.skull == SKULL_BLACK) then
        local query = db.getResult("SELECT `premium_points` FROM `accounts` WHERE `id` = " .. getPlayerAccountId(cid) .. ";")
        local playerPremiumPoints = query:getDataInt("premium_points")
        local remainingPoints = playerPremiumPoints - data.points
        if(playerPremiumPoints >= data.points) then
            local updateDatabase = db.executeQuery("UPDATE `accounts` SET `premium_points`= " .. remainingPoints .. " WHERE `id`= " .. getPlayerAccountId(cid) .. ";")
            if(updateDatabase == true) then            
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "Your skull has been taken off!\nRemaining premium points: " .. remainingPoints)
                doCreatureSetSkullType(cid, SKULL_NONE)
                if(getBooleanFromString(data.useLog) == true) then
                    doWriteLogFile("./data/logs/removeskull.log", "Success: " .. getCreatureName(cid))
                end
                if(getBooleanFromString(data.removeFrags) == true) then
                    doPlayerSetRedSkullTicks(cid, 0)
                end
                doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MAGIC_BLUE)
            else
                doPlayerSendCancel(cid, "Database error, please contact server staff.")
            end
        else
            doPlayerSendCancel(cid, "Sorry, you need " .. data.points .. " premium points to remove skull.")
       end
    else
        doPlayerSendCancel(cid, "Sorry, you don't have skull.")
    end
    if(query ~= nil) then
        query:free()
    end
    return true
end

Data/actions/actions.xml
PHP:
<action itemid="XXXX" script="nazwa_skryptu.lua"/>

@Micki
Hmm.. czym si? r??ni? Talkactions - tutaj dzieje si? wszystko co si? wi??e ze s?owami "/remove"
Actions - Tutaj si? dzieje wszystko na co dasz "Use"

PozdRRo.
 
Ostatnia edycja:
Odp: Support - pomoc przy pisaniu skrypt?w

Chcia?em si? zapyta? czy kto? mi wre?cie pomoze..:(


Siema, mam problem w tym skrypcie. Wpisuje id itemka ?adnie odbanowywuje, zabiera itemka, lecz mo?na odbanowywa? tak?e bez tego itemka.. jak zrobi? ?eby mo?na by?o odbanowywa? chara tylko z tym itemkiem..
Oto skrypt.

function onSay(cid, words, param, channel)
local itemek = 2160
if(param == '') then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.")
return true
end

local account, tmp = getAccountIdByName(param), true
if(account == 0) then
account = getAccountIdByAccount(param)
if(account == 0) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player or account '" .. param .. "' does not exists.")
return true
end

tmp = false
end

local ban = getBanData(account, BAN_ACCOUNT)
if(ban and doRemoveAccountBanishment(account)) then
local name = param
if(tmp) then
name = account
end

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, name .. " has been " .. (ban.expires == -1 and "undeleted" or "unbanned") .. ".")
doPlayerRemoveItem(cid, itemek, 1)
end

if(not tmp) then
return true
end

tmp = getIpByName(param)
if(isIpBanished(tmp) and doRemoveIpBanishment(tmp)) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "IP Banishment on " .. doConvertIntegerToIp(ip) .. " has been lifted.")
doPlayerRemoveItem(cid, itemek, 1)
end

local guid = getPlayerGUIDByName(param, true)
if(guid == nil) then
return true
end

ban = getBanData(guid, BAN_PLAYER, PLAYERBAN_LOCK)
if(ban and doRemovePlayerBanishment(guid, PLAYERBAN_LOCK)) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Namelock from " .. param .. " has been removed.")
doPlayerRemoveItem(cid, itemek, 1)
end

ban = getBanData(guid, BAN_PLAYER, PLAYERBAN_BANISHMENT)
if(ban and doRemovePlayerBanishment(guid, PLAYERBAN_BANISHMENT)) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, param .. " has been " .. (ban.expires == -1 and "undeleted" or "unbanned") .. ".")
doPlayerRemoveItem(cid, itemek, 1)
end

return true
end
 
Odp: Support - pomoc przy pisaniu skrypt?w

Kod:
function onUse(cid, item, frompos, item2, topos)
doCreatureSay(cid,"Your frags and skull have been removed.",TALKTYPE_ORANGE_1)
db.executeQuery("UPDATE `killers` SET `unjustified` = 0 WHERE `id` IN (SELECT `kill_id` FROM `player_killers` WHERE `player_id` = " .. getPlayerGUID(cid) .. ")")
doPlayerSetSkullEnd(cid, 0, SKULL_RED)            
doCreatureSetSkullType(cid, SKULL_NONE)
doRemoveItem(item.uid, 1)
return true
end

Prosze moze ktos poprawic ten skrypt
 
Odp: Support - pomoc przy pisaniu skrypt?w

Takie cos ;) :
PHP:
function onUse(cid, item, fromPosition, itemEx, toPosition)
doCreatureSay(cid,"Your frags and skull have been removed.",TALKTYPE_ORANGE_1)
db.executeQuery("UPDATE `killers` SET `unjustified` = 0 WHERE `id` IN (SELECT `kill_id` FROM `player_killers` WHERE `player_id` = " .. getPlayerGUID(cid) .. ")")
doPlayerSetSkullEnd(cid, 0, SKULL_RED)
doRemoveItem(item.uid, 1)
query:free()
return true
end
 
Odp: Support - pomoc przy pisaniu skrypt?w

Witam m?g?by? zerkn?? na ten skrypt to jest na kasyno co? mi nie dzia?a nie wiem czemu
jak by? m?g? to napraw z g?ry thx

@edit Pomo?e MI KTO? WRESZCIE???


function onUse(cid, item, frompos, item2, topos)
if item.uid == 4334 then
kasapos = {x=917, y=933, z=7, stackpos=255}
getkasa = getThingfromPos(kasapos)
winpos = {x=917, y=933, z=7}
if getkasa.itemid == 2160 and getkasa.type == 5 then
rand = math.random(4)
if rand == 1 or rand == 4 or rand == 3 then
doRemoveItem(getkasa.uid,5)
doSendMagicEffect(kasapos,2)
doPlayerSendTextMessage(cid,22,"Straciles 5 Crystal Coins :(.")
end
if rand == 2 then
doRemoveItem(getkasa.uid,5)
doCreateItem(2160,15,winpos)
doSendMagicEffect(winpos,13)
doSendMagicEffect(topos,21)
doPlayerSendTextMessage(cid,22," Gratulacje Wygrales 15 Crystal Coins :).")
end
end
if getkasa.itemid == 2160 and getkasa.type == 10 then
rand = math.random(4)
if rand == 1 or rand == 4 or rand == 3 then
doRemoveItem(getkasa.uid,10)
doSendMagicEffect(kasapos,2)
doPlayerSendTextMessage(cid,22,"Straciles 10 Crystal Coins :(.")
end
if rand == 2 then
doRemoveItem(getkasa.uid,10)
doCreateItem(2160,30,winpos)
doSendMagicEffect(winpos,13)
doSendMagicEffect(topos,21)
doPlayerSendTextMessage(cid,22,"Gratulacje Wygrales 30 Crystal Coins :).")
end
end
if getkasa.itemid == 2160 and getkasa.type == 25 then
rand = math.random(4)
if rand == 1 or rand == 4 or rand == 3 then
doRemoveItem(getkasa.uid,25)
doSendMagicEffect(kasapos,2)
doPlayerSendTextMessage(cid,22,"Straciles 25 Crystal Coins :(.")
end
if rand == 2 then
doRemoveItem(getkasa.uid,25)
doCreateItem(2160,75,winpos)
doSendMagicEffect(winpos,13)
doSendMagicEffect(topos,21)
doPlayerSendTextMessage(cid,22," Gratulacje Wygrales 75 Crystal Coins :) .")
end
end
if getkasa.itemid == 2160 and getkasa.type == 50 then
rand = math.random(4)
if rand == 1 or rand == 4 or rand == 3 then
doRemoveItem(getkasa.uid,50)
doSendMagicEffect(kasapos,2)
doPlayerSendTextMessage(cid,22,"Straciles 50 Crystal Coins :(.")
end
if rand == 2 then
doRemoveItem(getkasa.uid,50)
doCreateItem(2160,100,winpos)
doCreateItem(2160,50,winpos)
doSendMagicEffect(winpos,13)
doSendMagicEffect(topos,21)
doPlayerSendTextMessage(cid,22,"Gratulacje Wygrales 150 Crystal Coins :).")
end
end
if getkasa.itemid > 2160 or getkasa.itemid < 2160 then
doPlayerSendTextMessage(cid,22,"Poloz 5, 10, 25 Lub 50 Crystal Coins :) jezeli Chcesz Wejsc W Gre.")
end
if getkasa.itemid == 2160 and getkasa.type == 1 or getkasa.itemid == 2160 and getkasa.type == 2 or getkasa.itemid == 2160 and getkasa.type == 3 or getkasa.itemid == 2160 and getkasa.type == 4 or getkasa.itemid == 2160 and getkasa.type == 6 or getkasa.itemid == 2160 and getkasa.type == 7 or getkasa.itemid == 2160 and getkasa.type == 8
or getkasa.itemid == 2160 and getkasa.type == 9 or getkasa.itemid == 2160 and getkasa.type == 11 or getkasa.itemid == 2160 and getkasa.type == 12 or getkasa.itemid == 2160 and getkasa.type == 13 or getkasa.itemid == 2160 and getkasa.type == 14 or getkasa.itemid == 2160 and getkasa.type == 15 or getkasa.itemid == 2160 and getkasa.type == 16
or getkasa.itemid == 2160 and getkasa.type == 17 or getkasa.itemid == 2160 and getkasa.type == 18 or getkasa.itemid == 2160 and getkasa.type == 19 or getkasa.itemid == 2160 and getkasa.type == 20 or getkasa.itemid == 2160 and getkasa.type == 21 or getkasa.itemid == 2160 and getkasa.type == 22 or getkasa.itemid == 2160 and getkasa.type == 23
or getkasa.itemid == 2160 and getkasa.type == 24 or getkasa.itemid == 2160 and getkasa.type == 26 or getkasa.itemid == 2160 and getkasa.type == 27 or getkasa.itemid == 2160 and getkasa.type == 28 or getkasa.itemid == 2160 and getkasa.type == 29 or getkasa.itemid == 2160 and getkasa.type == 30 or getkasa.itemid == 2160 and getkasa.type == 31
or getkasa.itemid == 2160 and getkasa.type == 32 or getkasa.itemid == 2160 and getkasa.type == 33 or getkasa.itemid == 2160 and getkasa.type == 34 or getkasa.itemid == 2160 and getkasa.type == 35 or getkasa.itemid == 2160 and getkasa.type == 36 or getkasa.itemid == 2160 and getkasa.type == 37 or getkasa.itemid == 2160 and getkasa.type == 38
or getkasa.itemid == 2160 and getkasa.type == 39 or getkasa.itemid == 2160 and getkasa.type == 40 or getkasa.itemid == 2160 and getkasa.type == 41 or getkasa.itemid == 2160 and getkasa.type == 42 or getkasa.itemid == 2160 and getkasa.type == 43 or getkasa.itemid == 2160 and getkasa.type == 44 or getkasa.itemid == 2160 and getkasa.type == 45
or getkasa.itemid == 2160 and getkasa.type == 46 or getkasa.itemid == 2160 and getkasa.type == 47 or getkasa.itemid == 2160 and getkasa.type == 48 or getkasa.itemid == 2160 and getkasa.type == 49 or getkasa.itemid == 2160 and getkasa.type > 50 then
doPlayerSendTextMessage(cid,22,"Poloz 5, 10, 25 Lub 50 Crystal Coins :) jezeli Chcesz Wejsc W Gre.")
end
end
end
 
Ostatnia edycja:
Odp: Support - pomoc przy pisaniu skrypt?w

Chcia?em si? zapyta? czy kto? mi wre?cie pomoze..:(

PHP:
function onSay(cid, words, param, channel)
	local itemek = 2160
	if(param == '') then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.")
		return true
	end

	local account, tmp = getAccountIdByName(param), true
	if(account == 0) then
		account = getAccountIdByAccount(param)
			if(account == 0) then
				doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player or account '" .. param .. "' does not exists.")
			end
		return true
	tmp = false
	end

local ban = getBanData(account, BAN_ACCOUNT)
if(ban and doRemoveAccountBanishment(account)) then
local name = param
if(tmp) then
name = account
end

	doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, name .. " has been " .. (ban.expires == -1 and "undeleted" or "unbanned") .. ".")
	doPlayerRemoveItem(cid, itemek, 1)
end

if(not tmp) then
return true
end

tmp = getIpByName(param)

	if(isIpBanished(tmp) and doRemoveIpBanishment(tmp)) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "IP Banishment on " .. doConvertIntegerToIp(ip) .. " has been lifted.")
		doPlayerRemoveItem(cid, itemek, 1)
	end

local guid = getPlayerGUIDByName(param, true)
if(guid == nil) then
return true
end

ban = getBanData(guid, BAN_PLAYER, PLAYERBAN_LOCK)
	if(ban and doRemovePlayerBanishment(guid, PLAYERBAN_LOCK)) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Namelock from " .. param .. " has been removed.")
		doPlayerRemoveItem(cid, itemek, 1)
	end

ban = getBanData(guid, BAN_PLAYER, PLAYERBAN_BANISHMENT)
	if(ban and doRemovePlayerBanishment(guid, PLAYERBAN_BANISHMENT)) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, param .. " has been " .. (ban.expires == -1 and "undeleted" or "unbanned") .. ".")
		doPlayerRemoveItem(cid, itemek, 1)
	end

	return true
end

Sprawdz to. ;)

Kod:
function onUse(cid, item, frompos, item2, topos)
doCreatureSay(cid,"Your frags and skull have been removed.",TALKTYPE_ORANGE_1)
db.executeQuery("UPDATE `killers` SET `unjustified` = 0 WHERE `id` IN (SELECT `kill_id` FROM `player_killers` WHERE `player_id` = " .. getPlayerGUID(cid) .. ")")
doPlayerSetSkullEnd(cid, 0, SKULL_RED)            
doCreatureSetSkullType(cid, SKULL_NONE)
doRemoveItem(item.uid, 1)
return true
end
Prosze moze ktos poprawic ten skrypt

Ldrozd poprawi? Ci, ale chcia?e? ?eby u?y? bez pz wi?c zobacz to. ;)
PHP:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if getCreatureCondition(cid, CONDITION_INFIGHT) then 
		doPlayerSendCancel(cid, "You are currently in a fight.")
		db.executeQuery("UPDATE `killers` SET `unjustified` = 0 WHERE `id` IN (SELECT `kill_id` FROM `player_killers` WHERE `player_id` = " .. getPlayerGUID(cid) .. ")")
		doPlayerSetSkullEnd(cid, 0, SKULL_RED)
		doRemoveItem(item.uid, 1)
		query:free()
	else
		doCreatureSay(cid,"Your frags and skull have been removed.",TALKTYPE_ORANGE_1)
return true
end
 
Ostatnia edycja:
Odp: Support - pomoc przy pisaniu skrypt?w

@Up Nie zadziala ;]:
Kod:
function onUse(cid, item, fromPosition, itemEx, toPosition)
    if getCreatureCondition(cid, CONDITION_INFIGHT) == false then 
        db.executeQuery("UPDATE `killers` SET `unjustified` = 0 WHERE `id` IN (SELECT `kill_id` FROM `player_killers` WHERE `player_id` = " .. getPlayerGUID(cid) .. ")")
        doPlayerSetSkullEnd(cid, 0, SKULL_RED)
        doRemoveItem(item.uid, 1)
        query:free()
	  doCreatureSay(cid,"Your frags and skull have been removed.",TALKTYPE_ORANGE_1)
end
return true
end
Zadziala ;]
 
Status
Zamknięty.
Do góry