• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

come here come here

Rury

Member
Joined
Nov 25, 2012
Messages
74
Reaction score
7
hi otland,

First
It's possible when enter to tp go to residence town? I think is action or movement idk :D

Second

When a player reach 50 kills (frags) out broadcast >> "player " reach 50 kills. (storage 3000)
 
Last edited:
First
It's possible when enter to tp go to residence town? I think is action or movement idk :D

movements.xml
Code:
<movevent type="StepIn" actionid="xxxxx" event="script" value="filename.lua" />
actionid must be set in mapeditor, in floor, square which you want to tp players
xxxxx stands for number you enter in mapeditor

filename.lua
Code:
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

works fine on 0.3.7 for 9.6 if doesn't work make sure you put it in movements
 
Last edited:
Second.

Not tested but try this
in creaturescripts/scripts/killing.lua
Lua:
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
add this in creaturescripts/creaturescripts.xml
XML:
<event type="kill" name="KillingPlayers" event="script" value="killing.lua"/>
add thin in creaturescripts/scripts/login.lua
Lua:
registerCreatureEvent(cid, "KillingPlayers")
 
If u don't use it with another script u can. Did u check that value of storage was changed in database ?
 
Last edited:
I do not understand.

- - - Updated - - -

I have a custom script of kills with storage (3000). what I wanted to get to 50 murders and leaves a global message.

Something Like
Rury reach 50 kills. (broadcast)
 
Last edited:
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
Code:
doCreatureSay(cid, "You killed 50 players", TALKTYPE_ORANGE_1)
it it doens't change on kill it is a problem with "if".

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"?
 
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
Code:
doCreatureSay(cid, "You killed 50 players", TALKTYPE_ORANGE_1)
it it doens't change on kill it is a problem with "if".

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"?


It's missing the do broadcast (;playername: "has reached :get kills count: Kills")
 
hmm... It don't count kills and idk why, someone with better experience with tfs than me should help u. I'm a begginer too. Sorry
 
Back
Top