Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (strncmp(cmd, "/db", 3) == 0 && plr->profile_.ProfileData.isDevAccount)
- return Cmd_DestroyBarricade(plr, cmd);
- int ServerGameLogic::Cmd_DestroyBarricade(obj_ServerPlayer* plr, const char* cmd)
- {
- char buf[128];
- int x;
- if (2 != sscanf(cmd, "%s %d", buf, &x))
- return 5;
- ObjectManager& GW = GameWorld();
- for (GameObject* targetObj = GW.GetFirstObject(); targetObj; targetObj = GW.GetNextObject(targetObj))
- {
- if (targetObj->isObjType(OBJTYPE_Barricade))
- {
- obj_ServerBarricade* z = (obj_ServerBarricade*)targetObj;
- float dist = (plr->GetPosition() - targetObj->GetPosition()).Length();
- if (dist < x)
- {
- z->DestroyBarricade(), (plr, 100, 1, storecat_UsableItem);
- }
- }
- }
- return 0;
- }
- int Cmd_DestroyBarricade(obj_ServerPlayer* plr, const char* cmd);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement