/tpall - teleport every player to your location
/tp2p NAME- teleport to a players location
/tp2m NAME - teleport a player to me
If someone can make these for me, It would be super appreciated!:)
Printable View
/tpall - teleport every player to your location
/tp2p NAME- teleport to a players location
/tp2m NAME - teleport a player to me
If someone can make these for me, It would be super appreciated!:)
Here you go enjoy.
Quote:
if(strncmp(cmd, "/tome", 5) == 0 && plr->profile_.ProfileData.isDevAccount)
return Cmd_TeleportToPlayerMe(plr, cmd);
if(strncmp(cmd, "/goto", 4) == 0 && plr->profile_.ProfileData.isDevAccount)
return Cmd_TeleportToPlayer(plr, cmd);
Quote:
int ServerGameLogic::Cmd_TeleportToPlayer(obj_ServerPlayer* plr, const char* cmd)
{
char buf[128];
char find[64];
if(2 != sscanf(cmd, "%s %63c", buf, find))
return 2;
obj_ServerPlayer* tplr = FindPlayer(find);
if(tplr)
{
r3dPoint3D NewPos = tplr->loadout_->GamePos;
PKT_S2C_MoveTeleport_s n;
n.teleport_pos = NewPos;
p2pBroadcastToActive(plr, &n, sizeof(n));
plr->SetLatePacketsBarrier("teleport");
plr->TeleportPlayer(NewPos);
}
else
{
r3dOutToLog("%s Not Found\n", find);
return 3;
}
return 0;
}
int ServerGameLogic::Cmd_TeleportToPlayerMe(obj_ServerPlayer* plr, const char* cmd)
{
char buf[128];
char find[64];
if(2 != sscanf(cmd, "%s %63c", buf, find))
return 2;
obj_ServerPlayer* tplr = FindPlayer(find);
if(tplr)
{
r3dPoint3D NewPos = plr->loadout_->GamePos;
PKT_S2C_MoveTeleport_s n;
n.teleport_pos = NewPos;
p2pBroadcastToActive(tplr, &n, sizeof(n));
tplr->SetLatePacketsBarrier("teleport");
tplr->TeleportPlayer(NewPos);
}
else
{
r3dOutToLog("%s Not Found\n", find);
return 3;
}
return 0;
}
obj_ServerPlayer* ServerGameLogic::FindPlayer(char* Name)
{
FixedString c(Name);
c.ToLower();
obj_ServerPlayer* tplr;
for(int i=0; i<ServerGameLogic::MAX_NUM_PLAYERS; i++)
{
tplr = gServerLogic.GetPlayer(i);
if(!tplr) continue;
FixedString pn( tplr->userName);
pn.ToLower();
if(strstr(c,pn)) return tplr;
}
return NULL;
}
Quote:
int Cmd_TeleportToPlayerMe(obj_ServerPlayer* plr, const char* cmd);
int Cmd_TeleportToPlayer(obj_ServerPlayer* plr, const char* cmd);
obj_ServerPlayer* FindPlayer(char* Name);
Thank you so much DragonKon!
Now I can learn from reading all this to understand more:)
Very appreciated. :thumbup:
No problem therehere3 enjoy.
what is file?
thank crysis55