• 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!

CO tu jest źle?

Iranimes

Lua Zawodowiec
Joined
Jul 10, 2012
Messages
717
Reaction score
12
zrobiłem sobie:

Lua:
function onSay(cid, words, param)
	if(param == '') then
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Command param required.")
		return true
	end
	local t = string.explode(param, ",")
	if(not t[2] or not t[1]) then
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Invalid param specified.")
		return true
	end
	
	if isPlayer(getPlayerByName(t[1])) then
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Zmiana gracza: ".. t[1].." grupy na: ".. t[2] .."")
		setPlayerGroupId(getPlayerByName(t[1]), t[2])
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Done.")
	else
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Gracz: ".. t[1] .." nie jest graczem lub bledny nick/jest wylogowany.")
	end
	return true
end


i nie działa, tylko przy braku paramu wyrzuca, że nie ma paramu ale jak np. już jest /promote bla to nic nie dzieje się, a wyraźnie brakuje t[2]


0 błędów w konsoli, zacząłem używać tego 0.2 talaturena 9.86
 
Pewnie zwraca pusty string, porownaj t[1] i [2] z "".
Poza tym - tonumber.
 
Last edited:
stary, ale ja to zrobiłem dla testu na tym 0.2 i nie wywala ŻADNEGO BŁĘDU

i nie działa wgl
nie mam postaci o nazwie "test"
wpisytwałem /promote test, 5 i 0 errora i 0 efektu, a powinno wtedy pokazać, że nie ma takiego gracza, skrypt wtedy nie robi nic z liczbą po przecinku więc tam nie potrzebny jest tonumber



zresztą, tego też nie ma:

if(not t[2] or not t[1]) then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Invalid param specified.")
return true
end

tak jakby string.explode nie działał
 
Back
Top