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

C++ onSay

kuhi

Premium User
Premium User
Joined
Aug 26, 2012
Messages
200
Solutions
1
Reaction score
80
Location
x64dbg
GitHub
Kuhicop
I want to remove 1k from player everytime they say the word "tax"

function onSay(cid, "tax", param)
doPlayerRemoveMoney(cid, 1000)
end

I'm trying to add this at source code level, not as a script, I want to make it like "hard coded".

What I'm not sure, is how the function onSay should be called, if I can just give strings as parameters?
I'm not really sure how I have to deal with cid and param.

Any ideas?
Thanks!
 
What's the purpose of doing it in c++? I'm curious...
Because I already know to do it in lua, and I want to learn as I don't know how to do this
It's not for any development or something I'm not even going to implement it
You know bro learning purposes I don't learn anything trying things that I already know
 
Because I already know to do it in lua, and I want to learn as I don't know how to do this
It's not for any development or something I'm not even going to implement it
You know bro learning purposes I don't learn anything trying things that I already know
I see! Good that you want to learn...

Try going to Game.cpp line 3311 (Game:: PlayerSay)
 
I see! Good that you want to learn...

Try going to Game.cpp line 3311 (Game:: PlayerSay)
hehehe forgot to say I'm using otx mattyx14/otxserver (https://github.com/mattyx14/otxserver)
sorry I'm totally dumbfounded today but nvm I just used the search function and found it in that repo

for removing money, I've found an interesting function:
C++:
bool Game::removeMoney(Cylinder* cylinder, uint64_t money, uint32_t flags /*= 0*/)

But as you can see it's taking a parameter "Cylinder" which I don't know how to invoke, it should be a class or a structure (my thoughts) as it's creating an object
 
Last edited:
Back
Top