What's new

Skrypty & Kody Pomoc w kodzie "Fraglook"

Status
Not open for further replies.

sasugan2

Active User
Joined
May 18, 2010
Messages
99
Reaction score
4
Witam
M?g?by mi kto? pomoc i przerobi? ten kod, ?eby nawet po u?yciu frag removera nie kasowa?o frag?w z postaci? tylko ?eby one by?y tak jakby zawsze (skrypt polega na tym, ?e jak kliknimy na gracza to pokazuje jego liczbe zabojstw np 25) i chodzi o to, ?e jak si? ma te 25 frag?w i u?yjemy frag removera to wszystkie je kasuje a zale?y mi na tym, ?eby one si? zapisywa?y w?a?nie w tej liczbie

[LUA]function getPlayerFrags(cid)
local time = os.time()
local times = {today = (time - 86400), week = (time - (7 * 86400))}

local contents, result = {day = {}, week = {}, month = {}}, db.getResult("SELECT `pd`.`date`, `pd`.`level`, `p`.`name` FROM `player_killers` pk LEFT JOIN `killers` k ON `pk`.`kill_id` = `k`.`id` LEFT JOIN `player_deaths` pd ON `k`.`death_id` = `pd`.`id` LEFT JOIN `players` p ON `pd`.`player_id` = `p`.`id` WHERE `pk`.`player_id` = " .. getPlayerGUID(cid) .. " AND `k`.`unjustified` = 1 AND `pd`.`date` >= " .. (time - (30 * 86400)) .. " ORDER BY `pd`.`date` DESC")
if(result:getID() ~= -1) then
repeat
local content = {date = result:getDataInt("date")}
if(content.date > times.today) then
table.insert(contents.day, content)
elseif(content.date > times.week) then
table.insert(contents.week, content)
else
table.insert(contents.month, content)
end
until not result:next()
result:free()
end

local size = {
day = table.maxn(contents.day),
week = table.maxn(contents.week),
month = table.maxn(contents.month)
}
return size.day + size.week + size.month
end

function onLogin(cid)
registerCreatureEvent(cid, "fraglook")
return true
end

function onLook(cid, thing, position, lookDistance)
if isPlayer(thing.uid) and thing.uid ~= cid then
doPlayerSetSpecialDescription(thing.uid,'[Zabojstw: '..getPlayerFrags(thing.uid)..']')
return true
elseif thing.uid == cid then
doPlayerSetSpecialDescription(cid,'[Zabojstw: '..getPlayerFrags(cid)..']')
local string = 'You see yourself.'
if getPlayerFlagValue(cid, PLAYERFLAG_SHOWGROUPINSTEADOFVOCATION) then
string = string..' You are '.. getPlayerGroupName(cid) ..'.'
elseif getPlayerVocation(cid) ~= 0 then
string = string..' You are '.. getPlayerVocationName(cid) ..'.'
else
string = string..' You have no vocation.'
end
string = string..getPlayerSpecialDescription(cid)..''

if getPlayerNameByGUID(getPlayerPartner(cid), false, false) ~= nil then
string = string..' You are '.. (getPlayerSex(cid) == 0 and 'wife' or 'husband') ..' of '.. getPlayerNameByGUID(getPlayerPartner(cid)) ..'.'
end

if getPlayerGuildId(cid) > 0 then
string = string..' You are ' .. (getPlayerGuildRank(cid) == '' and 'a member' or getPlayerGuildRank(cid)) ..' of the '.. getPlayerGuildName(cid)
string = getPlayerGuildNick(cid) ~= '' and string..' ('.. getPlayerGuildNick(cid) ..').' or string..'.'
end

if getPlayerFlagValue(cid, PLAYERCUSTOMFLAG_CANSEECREATUREDETAILS) then
string = string..'nHealth: ['.. getCreatureHealth(cid) ..' / '.. getCreatureMaxHealth(cid) ..'], Mana: ['.. getCreatureMana(cid) ..' / '.. getCreatureMaxMana(cid) ..'].'
string = string..'nIP: '.. doConvertIntegerToIp(getPlayerIp(cid)) ..'.'
end

if getPlayerFlagValue(cid, PLAYERCUSTOMFLAG_CANSEEPOSITION) then
string = string..'nPosition: [X:'.. position.x..'] [Y:'.. position.y..'] [Z:'.. position.z..'].'
end
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, string)
return false
end
return true
end[/LUA]

---------- Tre?? dodana o 21:48 ----------

refresh
 

Zbizu

Luakami
Joined
Mar 13, 2010
Messages
719
Reaction score
104
Age
28
Odp: Pomoc w kodzie "Fraglook"

dodaj sobie do skrypta naliczaj?cego fragi ?eby zlicza? te? storage i potem pobieraj to storage zamiast getPlayerFrags
 

sasugan2

Active User
Joined
May 18, 2010
Messages
99
Reaction score
4
Odp: Pomoc w kodzie "Fraglook"

nie mam poj?cia jak to zrobi?, w tym jest problem ;d
 
Status
Not open for further replies.
Top