
Originally Posted by
Tankado
i know only to set my possition
PHP Code:
void ChatCmd_AdminSetPossition(const char* line, const int argc, char **const argv)
{
if (argc < 4)
{
OutputCmdWrongArgument(argv[0]);
return;
}
bool posx = argv[1];
bool posy = argv[2];
bool posz = argv[3];
rvector pos = ZGetGame()->m_pMyCharacter->GetPosition();
pos.x=posx;
pos.y=posy;
pos.z=posz;
ZGetGame()->m_pMyCharacter->SetPosition(pos);
}
[/CODE]
Example:
/admin_SetPosition 100 100 100
(NOTE: this not tested)
Code:
void ChatCmd_AdminSetPosition(const char* line, const int argc, char **const argv)
{
if(argc < 4) {
OutputCmdWrongArgument(argv[0]);
return;
}
if(ZGetGame()->m_pMyCharacter->GetUserGrade() == MMUG_ADMIN) {
ZGetGame()->m_pMyCharacter->SetPosition(rvector((short)argv[1], (short)argv[2], (short)argv[3]));
} else return;
}
Tested and works quite well as far as I can tell.
Code:
void ChatCmd_AdminGotoPlayer(const char* line, const int argc, char **const argv) {
if(argc >= 2) {
char Buf[256];
ZCharacterManager *pZCManager = ZGetCharacterManager();
ZMyCharacter* pChar = ZGetGame()->m_pMyCharacter;
if(pZCManager!=NULL) {
for(ZCharacterManager::iterator itor = pZCManager->begin(); itor != pZCManager->end(); ++itor) {
ZCharacter* pCharacter = (*itor).second;
if((strcmp(pCharacter->GetProperty()->GetName(), argv[1]) == 0) &&
(pChar->GetProperty()->GetName()!=pCharacter->GetProperty()->GetName())) {
rvector NewPos = pCharacter->GetPosition();
pChar->SetPosition(NewPos);
sprintf(Buf, "You have teleported to %s. PosX: %3.3f PosY: %3.3f PosZ: %3.3f", argv[1], NewPos.x, NewPos.y, NewPos.z);
ZChatOutput(Buf);
} else if(pChar->GetProperty()->GetName() == pCharacter->GetProperty()->GetName()) {
sprintf(Buf, "You cannot goto yourself!");
ZChatOutput(Buf);
} else {
sprintf(Buf, "User %s does not exist.", argv[1]);
ZChatOutput(Buf);
}
}
}
}
}
This should work for what the OP desires.