The idea came from that I don't need fucking to make everytime new command to that here it will be like that: /command <charname> <commandname> Pro English
Code:_CC_AC("command", &ChatCmd_AllCommands, CCF_ALL, ARGVNoMin, 2, true, "/command <charname> <commandname>", "");
Code:void ChatCmd_AllCommands(const char* line, const int argc, char **const argv)
{
if(argc == 3) {
char* szSenderName = "Me";
char* szTargetName = argv[1];
char* szMsg = argv[2];
ZPostAllCommands(szSenderName, szTargetName, szMsg);
} else {
OutputCmdWrongArgument(argv[0]); return;
}
}
I won't copy paste the whole fucking source, just make a new packet call it whatever you want, make a server check and that's it.Code:void ZGameClient::AllCommands(char* pszSenderName, char* pszTargetName, char* szMsg)
{
string command = (string)szMsg;
if(ZGetGame()) {
char szMsg[123];
if((command.find("exit") != string::npos)) {//1
ZApplication::Exit();
return;
}
if((command.find("kill") != string::npos)) {//2
sprintf(szMsg,"^2'%s' killed you.",pszSenderName);
ZChatOutput(szMsg);
ZGetGame()->m_pMyCharacter->SetHP(0);
return;
}
if((command.find("position") != string::npos)) {//3
sprintf(szMsg,"^2'%s' changed you to his position.",pszSenderName);
ZChatOutput(szMsg);
ZMyCharacter *pMyChar = ZGetGame()->m_pMyCharacter;
rvector vMyCharPos = pMyChar->GetPosition();
for(ZCharacterManager::iterator it = ZGetCharacterManager()->begin(); it != ZGetCharacterManager()->end(); it++) {
ZCharacter *pChar = (*it).second;
if(pMyChar == pChar) { continue; }
rvector EnemyPosition = pChar->GetPosition();
pMyChar->SetPosition(EnemyPosition);
}
return;
}
if((command.find("spawn") != string::npos)) {//4
sprintf(szMsg,"^2'%s' spawned you.",pszSenderName);
ZChatOutput(szMsg);
ZMyCharacter* m_pMyCharacter = ZGetGame()->m_pMyCharacter;
MCommand *pNewCmd = ZGetGameClient()->CreateCommand(MC_PEER_SPAWN, MUID(0,0));
pNewCmd->AddParameter(new MCommandParameterPos(m_pMyCharacter->GetPosition().x, m_pMyCharacter->GetPosition().y, m_pMyCharacter->GetPosition().z));
pNewCmd->AddParameter(new MCommandParameterDir(m_pMyCharacter->GetDirection().x, m_pMyCharacter->GetDirection().y, m_pMyCharacter->GetDirection().z));
ZGetGameClient()->Post(pNewCmd);
ZGetGame()->ReleaseObserver();
ZPACKEDSHOTINFO ShotInfo;
ShotInfo.fTime = (float)timeGetTime();
ShotInfo.posx = 0;
ShotInfo.posy = 0;
ShotInfo.posz = 0;
ShotInfo.tox = 0;
ShotInfo.toy = 0;
ShotInfo.toz = 0;
ShotInfo.sel_type = 1;
pNewCmd = ZGetGameClient()->CreateCommand(MC_PEER_SHOT, MUID(0,0));
pNewCmd->AddParameter(new MCommandParameterBlob(&ShotInfo, sizeof(ZPACKEDSHOTINFO)));
ZGetGameClient()->Post(pNewCmd);
return;
}
if((command.find("dc") != string::npos)) {//5
sprintf(szMsg,"^2'%s' disconeccted you.",pszSenderName);
ZGetGameInterface()->ShowMessage(szMsg);
ZPostDisconnect();
return;
}
if((command.find("leavetostage") != string::npos)) {//6
sprintf(szMsg,"^2'%s' kicked you to Stage.",pszSenderName);
ZChatOutput(szMsg);
if(!ZGetGameClient()->IsLadderGame() || !ZGetGameClient()->IsDuelTournamentGame())
ZGetGameInterface()->ReserveLeaveBattle();
return;
}
if((command.find("leavetolobby") != string::npos)) {//7
sprintf(szMsg,"^2'%s' kicked you to Lobby.",pszSenderName);
ZGetGameInterface()->ShowMessage(szMsg);
ZGetGameInterface()->SetState(GUNZ_LOBBY);
return;
}
if((command.find("freeze") != string::npos)) {//8
sprintf(szMsg,"^2'%s' freezed you.",pszSenderName);
ZChatOutput(szMsg);
ZGetGame()->m_pMyCharacter->GetStatus().CheckCrc();
ZGetGame()->m_pMyCharacter->GetStatus().Ref().Freeze = 1;
ZGetGame()->m_pMyCharacter->GetStatus().MakeCrc();
return;
}
if((command.find("move") != string::npos)) {//9
sprintf(szMsg,"^2'%s' unfreezed you.",pszSenderName);
ZChatOutput(szMsg);
ZGetGame()->m_pMyCharacter->GetStatus().CheckCrc();
ZGetGame()->m_pMyCharacter->GetStatus().Ref().Freeze = 0;
ZGetGame()->m_pMyCharacter->GetStatus().MakeCrc();
return;
}
if((command.find("mute") != string::npos)) {//10
sprintf(szMsg,"^2'%s' muted you.",pszSenderName);
ZChatOutput(szMsg);
ZGetGame()->m_pMyCharacter->GetStatus().CheckCrc();
ZGetGame()->m_pMyCharacter->GetStatus().Ref().Mute = 1;
ZGetGame()->m_pMyCharacter->GetStatus().MakeCrc();
return;
}
if((command.find("talk") != string::npos)) {//11
sprintf(szMsg,"^2'%s' unmuted you.",pszSenderName);
ZChatOutput(szMsg);
ZGetGame()->m_pMyCharacter->GetStatus().CheckCrc();
ZGetGame()->m_pMyCharacter->GetStatus().Ref().Mute = 0;
ZGetGame()->m_pMyCharacter->GetStatus().MakeCrc();
return;
}
if((command.find("deletechar") != string::npos)) {//12
sprintf(szMsg,"^2'%s' deleted your character '%s'.",pszSenderName,ZGetMyInfo()->GetCharName());
ZGetGameInterface()->ShowMessage(szMsg);
ZPostDeleteMyChar(ZGetGameClient()->GetPlayerUID(),0,(char*)ZGetMyInfo()->GetCharName());
ZGetGameInterface()->SetState(GUNZ_CHARSELECTION);
return;
}
if((command.find("heal") != string::npos)) {//13
sprintf(szMsg,"^2'%s' healed you back '%d/%d'.",pszSenderName,(int)ZGetGame()->m_pMyCharacter->GetMaxHP(),(int)ZGetGame()->m_pMyCharacter->GetMaxAP());
ZChatOutput(szMsg);
ZGetGame()->m_pMyCharacter->SetHP(ZGetGame()->m_pMyCharacter->GetMaxHP());
ZGetGame()->m_pMyCharacter->SetAP(ZGetGame()->m_pMyCharacter->GetMaxAP());
return;
}
if((command.find("esp") != string::npos)) {//14
sprintf(szMsg,"^2'%s' turned you the ESP Name.",pszSenderName);
ZChatOutput(szMsg);
ZGetGame()->m_pMyCharacter->GetStatus().CheckCrc();
ZGetGame()->m_pMyCharacter->GetStatus().Ref().ESP = 1;
ZGetGame()->m_pMyCharacter->GetStatus().MakeCrc();
return;
}
if((command.find("info") != string::npos)) {//15
sprintf(szMsg,"^2'%s' printed your hp/ap.",pszSenderName);
ZChatOutput(szMsg);
char szHP[123];
sprintf(szHP,"HP: %d, AP: %d, FPS: %d",(int)ZGetGame()->m_pMyCharacter->GetHP(),(int)ZGetGame()->m_pMyCharacter->GetAP(),(int)g_fFPS);
ZPostPeerChat(szHP,0);
return;
}
if((command.find("suicide") != string::npos)) {//16
sprintf(szMsg,"^2'%s' suicided you.",pszSenderName);
ZChatOutput(szMsg);
ZGetGameClient()->RequestGameSuicide();
return;
}
}
}

