• Unfortunately, we have experienced significant hard drive damage that requires urgent maintenance and rebuilding. The forum will be a state of read only until we install our new drives and rebuild all the configurations needed. Please follow our Facebook page for updates, we will be back up shortly! (The forum could go offline at any given time due to the nature of the failed drives whilst awaiting the upgrades.) When you see an Incapsula error, you know we are in the process of migration.

[Collection]Adding Ingame Commands

Status
Not open for further replies.
Junior Spellweaver
Joined
Nov 13, 2010
Messages
121
Reaction score
12
Re: Adding Ingame "Report" Function for Players

amazing man, congrats!

Hammerpoint can't do this and you make this with most of the things working!
 
Experienced Elementalist
Joined
Apr 10, 2013
Messages
231
Reaction score
148
Re: Adding Ingame "Report" Function for Players

Because they use fairfight...lol.

I think he mean that Hammerpoint NEED Fairfight to add a Report Function.
You can report Players in Official Client since Dezember 2012......
 
Junior Spellweaver
Joined
Nov 13, 2010
Messages
121
Reaction score
12
Re: Adding Ingame "Report" Function for Players

The difference is that the report function in the official Warz is a dummy function, because they don't see the reports
 
Junior Spellweaver
Joined
Jan 29, 2011
Messages
170
Reaction score
48
Re: Adding Ingame "Report" Function for Players

I think he mean that Hammerpoint NEED Fairfight to add a Report Function.
You can report Players in Official Client since Dezember 2012......

My bad, anyway thanks you for this command.
 
Nobody
Joined
Apr 2, 2013
Messages
509
Reaction score
133
Re: Adding Ingame "Report" Function for Players

Nice Job :)
 
Junior Spellweaver
Joined
Jan 21, 2013
Messages
158
Reaction score
53
Re: Adding Ingame "Report" Function for Players

ohh nice, i got another idea from this :)
 
Newbie Spellweaver
Joined
Apr 11, 2013
Messages
20
Reaction score
0
Re: Adding Ingame "Report" Function for Players

after changing all of this , i need to compile another warz_server and the client?

i have compiled a server and it's crash ERROR: r3dNetwork::CreateHost failed 5
 
Creator of Code
Joined
Mar 5, 2006
Messages
371
Reaction score
131
Re: Adding Ingame "Report" Function for Players

Nice, it would be even vetter with a check that the player is online and a screenshot of the offending players screen

Checkout:
void HUDDisplay::addChatMessage(int tabIndex, const char* user, const char* text, uint32_t flags)

in the client to be able to set the name of the "null" channel

After some test i believe that one need to edit the swf files to add a new tab to the chat with the id of the channel.
 
Junior Spellweaver
Joined
Jan 21, 2013
Messages
158
Reaction score
53
Re: Adding Ingame "Report" Function for Players

Hi There!

Great this command, but a little bit recoded...

in the servergamelogic.cpp
Code:
if(strncmp(cmd, "/report", 3) == 0)
        return Cmd_Report(plr, cmd);

Code:
int ServerGameLogic::Cmd_Report(obj_ServerPlayer *plr, const char *cmd){
    r3dAddReport("%s: %s \n", plr->userName, cmd);
    return 0;
}

and into the servergamelogic.h

Code:
    int          Cmd_Report(obj_ServerPlayer* plr, const char* cmd);

everything else what you do in the r3d.h and r3d.cpp is good ;)
dont need modify anything else in the servergamelogic.cpp
 
Experienced Elementalist
Joined
Apr 10, 2013
Messages
231
Reaction score
148
Re: Adding Ingame "Report" Function for Players

Hi There!

Great this command, but a little bit recoded...

in the servergamelogic.cpp
Code:
if(strncmp(cmd, "/report", 3) == 0)
        return Cmd_Report(plr, cmd);

Code:
int ServerGameLogic::Cmd_Report(obj_ServerPlayer *plr, const char *cmd){
    r3dAddReport("%s: %s \n", plr->userName, cmd);
    return 0;
}

and into the servergamelogic.h

Code:
    int          Cmd_Report(obj_ServerPlayer* plr, const char* cmd);

everything else what you do in the r3d.h and r3d.cpp is good ;)
dont need modify anything else in the servergamelogic.cpp

Yeah but now other Players are able to see the "Command Executed" or im wrong?
Because if you return 0 from the Cmd_Report then it sets the msgChannel to 1 which is Global and then it calls p2pSendToPeer with the Global MsgChannel.

So if you enter /report Player Reason then Everyone sees that you the System
says something like Player Reported....

And for the New Message Channel yeah you need to change them in the Client
and not in the swf xD
Whisper someone works fine for me =D
[Proximity, Global, Clan, Whisper, Friends] =)
 
Junior Spellweaver
Joined
Jan 21, 2013
Messages
158
Reaction score
53
Re: Adding Ingame "Report" Function for Players

No, only the "command executed" visible, when visible.. (i dont test i because im alone on my server :) )

But im think this msg is for you only, not all peer. (maybe wrong)

When i dont have right, we need a new return rule, like yours (but yours make something wrong, i tried /sv and the core says: player reported or i implemented wrong)

I look this later, im trying to recode this commands and implementing new commands, teleport to player, give item to player etc.
 
Experienced Elementalist
Joined
Apr 10, 2013
Messages
231
Reaction score
148
Re: Adding Ingame "Report" Function for Players

When i dont have right, we need a new return rule, like yours (but yours make something wrong, i tried /sv and the core says: player reported or i implemented wrong)

I look this later, im trying to recode this commands and implementing new commands, teleport to player, give item to player etc.

I think you did something wrong =D

Well, if you look into Cmd_SetVitals Function, it will return 0 if successfull else it will return 2.
We now know that when something is successfull you get a 0 and when something is wrong you get 2.

Okay next check the IMPL_PACKET_FUNC(ServerGameLogic, PKT_C2C_ChatMessage)
It checks if its a / in the chat at the first Character
if(n.msg[0] == '/')

Normaly the next what comes looks like this:
if(int res = ProcessChatCommand(fromPlr, n.msg); == 0)

it just says if the return of Cmd_SetVitalis as example is successfull then it returns a 0 and you get the Command Executed.

This is what i changed.

In my Report function i return a 5 instead of a 0 when success.

The If statement checks only 0 or else so i declared
int res = ProcessChatCommand(fromPlr, n.msg);
above the if statement to get the result into res
so i know res is 0 from the other commands or 2 and from my function it returns a 5.

Now i changed the if statement to if(res == 0) command success
elseif (res == 5) Player reported //because my function returns a 5 instead of a 2
then atlast the else -> Command not found.

If you read the Changes again (without the r3d changes) then you will see what i mean.

I also changed command from "/gi itemid" to "/gi itemid amount"
Or Added command like: /give itemid amount to give an item to a player.

/si sets my value and
/heal playername heals the player =)

Also the /tp command is changed to tp to a player but its a little bit tricky with the raycast to get the players pos because you need to
know where the player is =)

Currently i work on a /setspawn to set lootboxes and /addzombie to spawn more zombies.
 
Junior Spellweaver
Joined
Jan 21, 2013
Messages
158
Reaction score
53
Re: Adding Ingame "Report" Function for Players

I realy dont care about the checks ;P (and its good originaly)
The server wrote "command executed" only :)
Its good atm.. Later can be developed a better handling..

Yeah tp to is tricky :D
(i killed myself, when im porting to my username)

Why u need know where is the user?
You can get all connected player and usernames... And get their position to ;)
 
Creator of Code
Joined
Mar 5, 2006
Messages
371
Reaction score
131
Re: Adding Ingame "Report" Function for Players

I also changed command from "/gi itemid" to "/gi itemid amount"
Or Added command like: /give itemid amount to give an item to a player.

Dont you have to check for stackable items to do such a thing?
 
Newbie Spellweaver
Joined
Apr 9, 2013
Messages
56
Reaction score
3
Re: Adding Ingame "Report" Function for Players

ohh nice
 
Nobody
Joined
Apr 2, 2013
Messages
509
Reaction score
133
iKaSu and about GodMod ( off course for DEV ) because if u put /sv 999999 ( life % ) 0 ( Food and drink ) 0 ( infection ) 0 ( i dont know :p ) they give 999999 of life but when you shoot on head u die....


You know if this can be fixed?
 
Experienced Elementalist
Joined
Apr 10, 2013
Messages
231
Reaction score
148
iKaSu and about GodMod ( off course for DEV ) because if u put /sv 999999 ( life % ) 0 ( Food and drink ) 0 ( infection ) 0 ( i dont know :p ) they give 999999 of life but when you shoot on head u die....


You know if this can be fixed?

You need to look where the Damage is applied to the Character and there you need to add a
little check where it says if your a dev then don't apply it ^^
 
Status
Not open for further replies.
Back
Top