• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Skrypt poprawka

TriamerA

The Mystic One.
Joined
Nov 16, 2008
Messages
1,257
Reaction score
18
Location
Poland
Mam tu taki skrypcik niestety nie działa funkcja 'checking'
Skrypt powinien usuwać graczowi 5 soul points co każde x sekund jeżeli gracz stoi na kratce i jest online (taki anty 24/7 bot na trainerach).


wywala mi:

Code:
[Error - MoveEvents Interface] 
In a timer event called from: 
data/movements/scripts/soulless.lua:onStepIn
Description: 
(luaDoPlayerSendCancel) Player not found


A o to skrypt

Code:
function onStepIn(cid, item, pos)



    if (item.actionid == 18888) then
if getPlayerSoul(cid) > 5 then
		--player can enter
		doPlayerSendCancel(cid, "Happy Training.")
		addEvent(checking, 3 * 1000)
		else
		doPlayerSendCancel(cid, "You have not enough soul points.")
		--player can't enter
end
end



    return TRUE
end  

	
	function checking(cid)
	 if (isPlayer(cid) == true) then --checking if player is online
	if getPlayerSoul(cid) > 5 then
		doPlayerAddSoul(cid, -5)
		doPlayerSendCancel(cid, "Removed 5 soul Points.")
		addEvent(checking,  3 * 1000)
	else
	end
	else
	doTeleportThing(cid, {x = xxxx, y = xxxx, z = xxxx})
	doPlayerSendCancel(cid, "You have not enough soul points, go hunt to get them.")
	end
	


return true
end


Trzeba by było także sprawdzić czy gracz stoi dalej na tej kratce, jeżeli nie to dać stopEvent.

Rep++
 
Back
Top