Hello Otlanders, i appeal to You to ask for help. I tried to write my own script (TFS 0.3.6) that would operate on the principle of: a player loggins in to the game, it displays the message "welcome!" (this part works in my script), in the first 2 seconds he cannot logout (pz block + not working), and the console shows him the current number of all frags (not working). I tried different ways but nothing works like I want to. Here's my script and console errors (after trying to log on to the game character). Can You explain to me what I was doing wrong?:
Errors:
+ I have register in login.lua
PHP:
function onLogin(cid)
setCombatCondition(combat, condition)
doSendAnimatedText(getPlayerPosition(cid), "Welcome!", TEXTCOLOR_WHITE)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, (getPlayerFrags(cid)), "Amount of Your frags.")
return TRUE
end
Errors:
Code:
[04/10/2011 19:02:41] Administrator has logged in.
[04/10/2011 19:02:41] [Error - CreatureScript Interface]
[04/10/2011 19:02:41] data/creaturescripts/scripts/battleonlogin.lua:onLogin
[04/10/2011 19:02:41] Description:
[04/10/2011 19:02:41] (luaSetCombatCondition) This function can only be used while loading the script.
[04/10/2011 19:02:42] [Error - CreatureScript Interface]
[04/10/2011 19:02:42] data/creaturescripts/scripts/battleonlogin.lua:onLogin
[04/10/2011 19:02:42] Description:
[04/10/2011 19:02:42] data/creaturescripts/scripts/battleonlogin.lua:4: attempt to call global 'getPlayerFrags' (a nil value)
[04/10/2011 19:02:42] stack traceback:
[04/10/2011 19:02:42] data/creaturescripts/scripts/battleonlogin.lua:4: in function <data/creaturescripts/scripts/battleonlogin.lua:1>
[04/10/2011 19:02:42] Administrator has logged out.