Elzza
-
Posts
19 -
Joined
-
Last visited
-
Feedback
0%
Content Type
Forums
Store
Third Party - Providers Directory
Feature Plan
Release Notes
Docs
Events
Posts posted by Elzza
-
-
Just, implement the constructor inside smth.cpp and also give a DEFAULT value to smth[3]; (or maybe include the array inside the class)
In my full code, I've done it earlier, but error is still.
edited code:
test.h
class test { public: int global_var[3]; // Global Variable test(); void write(int nmb); int read(); }; extern test testt;
test.cpp
#include "test.h" ... test::test() { global_var[0] = 0; global_var[1] = 0; global_var[2] = 0; } void test::write(int nmb) { global_var[0] = nmb; } int test::read() { return global_var[0]; }
smth.h
extern int smth[3];
smth.cppint smth[3] = {1,2,3};
I don't like such awful thing:extern test testt;
I did it because I want to use only one class object in different functions.
How can I do it differently?
-
I wrote a function that uses a global variable, but this variable isn't working properly.
A function that reads / records the number to this variable, not always doing it properly, why?
test.h
int global_var[3]; // Global Variable class test { public: void write(int nmb); int read(); }; extern test testt;
test.cpp
#include "test.h" ... void test::write(int nmb) { global_var[0] = nmb; } int test::read() { return global_var[0]; }
questlua_pc.cpp
... #include "test.h" ... test testt; int pc_test_func_write(lua_State* L) { testt.write(lua_tonumber(L,1)); return 1; } int pc_test_func_read(lua_State* L) { lua_pushnumber(L, testt.read()); return 1; } ... {"test_func_write", pc_test_func_write }, {"test_func_read", pc_test_func_read },
This is a sample code.
How can I fix it?
-
1.Could somebody tell me how to create a new function, which will verify when the player is dead?
In quest could look like this: while pc.dead begin
Or only using lua.
-
I wrote a code which should send the number to lua (quest), but something is wrong.
This code isn't sending number to lua, why?
Plik questlua_pc.cpp:
... int pc_my_func(lua_State* L) { ... lua_pushnumber(L, 0); return 0; ... } ...
and quest test.quest:
quest test begin state start begin when blacksmith.chat."test" begin say("test") local var = pc.my_func() say(var) end end end
-
-
When players are fighting, they can't use the potions, like red, blue etc.
I want give them prohibit the use of potions.
-
How to set a ban on the use of potions?
And second question: How to remove player party?
Of course, using c++.
-
Thank You!
-
I have problem, my code isn't reading properly data from MySQL, type: smallint.
There is number: 64, but this function show me number: 54.
I don't know what is wrong.
My code:
short MyFunction() { ... std::auto_ptr<SQLMsg> msg(DBManager::instance().DirectQuery("SELECT coins FROM player.itemshop WHERE name='%s';", pCharName)); MYSQL_ROW row_coins = mysql_fetch_row(msg->Get()->pSQLResult); return row_coints[0][0]; }
-
-
You can add new tables in MySQL, like: id_account | id_item | item_count | attr_type1 | attr_value | ... | attr_value6 | socket1 | socket2 | ... | socket5
And add new quest function which will add new data to your tables and delete old item from game or use only quest.
Write quest and it's all
-
Yea, I should use pc.myfunction but "CPVPManager::instance().Insert()" isn't starting pvp but giving invitation to fight.
Hm?
-
It's not work.
#edit
I have to do somewere mistake, because my code looks like this:
int pc_start_pvp(lua_State* L) { LPCHARACTER pChar1 = CQuestManager::instance().GetCurrentCharacterPtr(); //DWORD pid1 = pChar1->GetPlayerID(); LPCHARACTER pChar2 = CHARACTER_MANAGER::instance().FindPC(lua_tostring(L,1)); //DWORD pid2 = pChar2->GetPlayerID; if ( pChar1 == NULL || pChar2 == NULL ) { //lua_pushnumber(L, 0); return 0; } CPVPManager::instance().Insert(pChar1, pChar2); pChar1->ChatPacket(CHAT_TYPE_INFO, "It's not work1!"); pChar2->ChatPacket(CHAT_TYPE_INFO, "It's not work2!"); return 1; }
1. I include: "#include "pvp.h" and add: "{ "start_pvp", pc_start_pvp }," to "void RegisterPCFunctionTable()".
2. I was add this: "start_pvp()" in "quest_funcitons" and I was create quest:
quest pvp begin state start begin when blacksmith.chat."test_pvp" begin say("Nick") local nick= input() start_pvp(nick) say("done!") end end end
But when I wirte nick, nothing happened.
-
-
No, because I want to insert into this function something else.
-
I want to make a new quest function, which will start pvp between 2 players.
I don't know how I can do it.
Could You give me an example how to make this function?
Now, I have this code:
int pc_start_pvp(lua_State* L) { LPCHARACTER pChar1 = CQuestManager::instance().GetCurrentCharacterPtr(); DWORD pid1 = pChar1->GetPlayerID(); LPCHARACTER pChar2 = CHARACTER_MANAGER::instance().FindPC(lua_tostring(L,1)); DWORD pid2 = pChar2->GetPlayerID; if ( pChar1 == NULL || pChar2 == NULL ) { lua_pushnumber(L, 0); return 0; } lua_pushnumber(L, 0); return 1; }
Pls, help me.
-
1. I have db and game from mainline released
2. Could you give me a good item_proto?
-
Hey, I have problem, I compiled game from mainline released, but DS stone isn't in inventory of alchemy.
How to fix it?
How to use duel arena for new map?
in Community Support - Questions & Answers
Posted