Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
callClientFunction zwraca wartość null
#2
jeżeli np. chcesz zapisać gdzieś tą wartość to używasz w kliencie :

callServerFunc("Zapis", heroId, getExp());

Serwer :

function Zapis(pid, exp)
{
print(exp);
}

Prawdopodobnie zwróci ci exp Smile.
Najprościej jednak mieć gdzieś zapisane na serwerze te funkcje.
Powiedzmy na szybko wklepane :
Players <- [];

for (local i = 0; i < getMaxSlots(); ++i)
{
Players[i] <- {};
Players[i].exp <- 0;
}


function setPlayerExp(pid, val)
{
Players[pid].exp = val;
callClientFunc(pid, "setExp", val);
}

function getPlayerExp(pid)
{
return Players[pid].exp;
}

Jak chcesz zrozumiec jak działa wysyłanie pakietu itd. Popróbuj bez callClientFunc,callServerFunc tylko na sendPacket
Reply


Messages In This Thread
RE: callClientFunction zwraca wartość null - by Quarchodron - 21.01.2018, 20:06

Forum Jump:


Users browsing this thread: 1 Guest(s)