First
It's possible when enter to tp go to residence town? I think is action or movement idk
<movevent type="StepIn" actionid="xxxxx" event="script" value="filename.lua" />
function onStepIn(cid, item, pos)
towns = {
[1] = {x=512, y=512, z=7},
[2] = {x=1000, y=1000, z=7},
[3] = {x=854, y=771, z=7}
}
doTeleportThing(cid,towns[getPlayerTown(cid)])
return 1
end
local frags = 50000
function onKill(cid, target, lastHit)
if isPlayer(target) then
if getCreatureStorage(cid, frags) > 0 and getCreatureStorage(cid, frags) ~= 50 then
doCreatureSetStorage(cid, frags, getCreatureStorage(cid, frags) + 1)
elseif getCreatureStorage(cid, frags) == 50 then
doCreatureSay(cid, "You killed 50 players", TALKTYPE_ORANGE_1)
doCreatureSetStorage(cid, frags, getCreatureStorage(cid, frags) + 1)
elseif getCreatureStorage(cid, frags) < 0 then
doCreatureSetStorage(cid, frags, 0)
end
end
return true
end
<event type="kill" name="KillingPlayers" event="script" value="killing.lua"/>
registerCreatureEvent(cid, "KillingPlayers")
doCreatureSay(cid, "You killed 50 players", TALKTYPE_ORANGE_1)
local frags = 50000
function onKill(cid, target, lastHit)
if isPlayer(target) then
if getCreatureStorage(cid, frags) > 0 then
if getCreatureStorage(cid, frags) ~= 50 then
doCreatureSetStorage(cid, frags, getCreatureStorage(cid, frags) + 1)
else
doCreatureSay(cid, "You killed 50 players", TALKTYPE_ORANGE_1)
doCreatureSetStorage(cid, frags, getCreatureStorage(cid, frags) + 1)
end
else
doCreatureSetStorage(cid, frags, 0)
end
end
return true
end
Your database keep storages in 'players_storage' table u can check it with phpmyadmin or navicat for exmaple. It changes on kill it is some problem with
it it doens't change on kill it is a problem with "if".Code:doCreatureSay(cid, "You killed 50 players", TALKTYPE_ORANGE_1)
U can try this:
Lua:local frags = 50000 function onKill(cid, target, lastHit) if isPlayer(target) then if getCreatureStorage(cid, frags) > 0 then if getCreatureStorage(cid, frags) ~= 50 then doCreatureSetStorage(cid, frags, getCreatureStorage(cid, frags) + 1) else doCreatureSay(cid, "You killed 50 players", TALKTYPE_ORANGE_1) doCreatureSetStorage(cid, frags, getCreatureStorage(cid, frags) + 1) end else doCreatureSetStorage(cid, frags, 0) end end return true end
do u want to broadcast it to all players "that player killed 50 players" or only info for player "You killed 50 players"?