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 ;)
22-04-13
chreadie
Re: Adding Ingame "Report" Function for Players
Quote:
Originally Posted by iKasu
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?
25-04-13
animehdth
Re: Adding Ingame "Report" Function for Players
ohh nice
28-04-13
folkz
Re: [Collection]Adding Ingame Commands
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?
30-04-13
iKasu
Re: [Collection]Adding Ingame Commands
Quote:
Originally Posted by folkz
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 ^^
30-04-13
vinnieshuda
Re: [Collection]Adding Ingame Commands
Its easy to skip damage if you are a dev :)
30-04-13
ccleanerz
Re: [Collection]Adding Ingame Commands
Or make a god armor if you don't know how to make the godmode.
30-04-13
aLca
Re: [Collection]Adding Ingame Commands
Quote:
Originally Posted by ccleanerz
Or make a god armor if you don't know how to make the godmode.
Good Point. This Ranger-Light-Armor could do this job.
12-05-13
PhB
Re: [Collection]Adding Ingame Commands
Added /spv command to give vitals to another player:
Spoiler:
Needed Files to be changed:
\WarZ Game Server\ServerGameLogic.cpp
\WarZ Game Server\ServerGameLogic.h
ServerGameLogic.h - Line 158:
Add
Code:
int GetPlayerStruct(peerInfo_s& pr, const char* user);
int Cmd_SetPlayerVitals(obj_ServerPlayer* plr, const char* cmd);
if (GetPlayerStruct(pr, user))
{
pr.player->loadout_->Health = (float)v1;
pr.player->loadout_->Hunger = (float)v2;
pr.player->loadout_->Thirst = (float)v3;
pr.player->loadout_->Toxic = (float)v4;
r3dOutToLog("Cmd_SetPlayervitals: %s was given %f, %f, %f and %f\n", user, v1, v2, v3, v4);
return 0;
}
r3dOutToLog("Cmd_SetPlayerVitals: Player %s not Found!", user);
return 2;
}
How-To-Use: /spv username health hunger thirst toxic
Hint: function ServerGameLogic::GetPlayerStruct() can be used for other teleport command to reduce code.
BTW small glitch in Teleport Admin to Player function, here's fix:
Spoiler:
Change
Code:
r3dOutToLog("Cannot fine: %s!\n", user);
}
r3dOutToLog("There was an Error while Searching for Players!\n");
return 2;
if (GetPlayerStruct(pr, user))
{
if(g_pWeaponArmory->getConfig(itemid) == NULL) {
r3dOutToLog("Cmd_GiveItem: no item %d\n", itemid);
return 3;
}
wiInventoryItem wi;
wi.itemID = itemid;
wi.quantity = amount;
pr.player->BackpackAddItem(wi);
return 0;
}
r3dOutToLog("Cmd_GivePlayerItem: Player %s not Found!", user);
return 2;
}
How-To-Use: /gpi username itemid amount
Hint: code is using previous added function GetPlayerStruct() (see post above)
13-05-13
momk100
Re: [Collection]Adding Ingame Commands
Good work PhB +1
15-05-13
PhB
Re: [Collection]Adding Ingame Commands
New GodMode command (not fully tested, pretty alone atm on my srv, should work for player<->player, tested with zombies):
Added /gm command to give player godmode status on or off (leading to ApplyDamageToPlayer() ineffective and/or Zombies attitude):
Spoiler:
Needed Files to be changed:
\WarZ Game Server\sobj_Zombie.cpp
\WarZ Game Server\obj_ServerPlayer.h
\WarZ Game Server\obj_ServerPlayer.cpp
\WarZ Game Server\ServerGameLogic.cpp
\WarZ Game Server\ServerGameLogic.h
bool obj_Zombie::SenseWeaponFire(const obj_ServerPlayer* plr, const ServerWeapon* wpn)
{
if(ZombieState == EZombieStates::ZState_Dead)
return false; // no attack while dead.
if(ZombieState == EZombieStates::ZState_Waking)
return false; // give him time to wake!
Add:
Code:
if (plr->GodMode == 2)
return false;
Look for:
Code:
case EZombieStates::ZState_Attack:
{
obj_ServerPlayer* trg = IsServerPlayer(GameWorld().GetObject(hardObjLock));
int ServerGameLogic::Cmd_GodMode(obj_ServerPlayer* plr, const char* cmd){
char buf[128];
int onoff;
sscanf(cmd, "%s %d", buf, &onoff);
plr->GodMode = onoff;
r3dOutToLog("Setting godmode for %s to %d!", plr->userName, onoff);
return 0;
}
How-To-Use: /gm [status]
where
[status] = 0 -> godmode OFF
[status] = 1 -> godmode ON but detectable by zombies
[status] = 2 -> godmode ON and not detectable by Zombies
Hint: even with GodMode=2, zombie if hit *will* begin to walk toward sound origin but won't attack
15-05-13
Liphe_xD
Re: [Collection]Adding Ingame Commands
Quote:
Originally Posted by PhB
New GodMode command (not fully tested, pretty alone atm on my srv, should work for player<->player, tested with zombies):
Added /gm command to give player godmode status on or off (leading to ApplyDamageToPlayer() ineffective and/or Zombies attitude):
Spoiler:
Needed Files to be changed:
\WarZ Game Server\sobj_Zombie.cpp
\WarZ Game Server\obj_ServerPlayer.h
\WarZ Game Server\obj_ServerPlayer.cpp
\WarZ Game Server\ServerGameLogic.cpp
\WarZ Game Server\ServerGameLogic.h
bool obj_Zombie::SenseWeaponFire(const obj_ServerPlayer* plr, const ServerWeapon* wpn)
{
if(ZombieState == EZombieStates::ZState_Dead)
return false; // no attack while dead.
if(ZombieState == EZombieStates::ZState_Waking)
return false; // give him time to wake!
Add:
Code:
if (plr->GodMode == 2)
return false;
obj_ServerPlayer.h
------------------
Look for:
Code:
float deathTime;
void DoDeath();
Add
Code:
int GodMode;
obj_ServerPlayer.cpp
--------------------
in function obj_ServerPlayer::OnCreate():
Look for:
Code:
FireHitCount = 0;
Add:
Code:
GodMode = 0;
ServerGameLogic.h
------------------
Look for:
Code:
int ProcessChatCommand(obj_ServerPlayer* plr, const char* cmd);
Add:
Code:
int Cmd_GodMode(obj_ServerPlayer* plr, const char* cmd);
int ServerGameLogic::Cmd_GodMode(obj_ServerPlayer* plr, const char* cmd){
char buf[128];
int onoff;
sscanf(cmd, "%s %d", buf, &onoff);
plr->GodMode = onoff;
r3dOutToLog("Setting godmode for %s to %d!", plr->userName, onoff);
return 0;
}
How-To-Use: /gm [status]
where
[status] = 0 -> godmode OFF
[status] = 1 -> godmode ON but detectable by zombies
[status] = 2 -> godmode ON and not detectable by Zombies
Hint: even with GodMode=2, zombie if hit *will* begin to walk toward sound origin but won't attack
here appears: command executed
but dont works..
zombies still killing me =/
EDIT: I forgot to change sobj_Zombie.cpp, now works fine ^^
15-05-13
Lewis Caddick
Re: [Collection]Adding Ingame Commands
can some help me with the part where it says Add Below the ProcessChatCommand for the commands. i cant find that part
16-05-13
PhB
Re: [Collection]Adding Ingame Commands
That means: after the ProcessChatCommand function in ServerGameLogic.cpp file, add this code, which is a new function.